38 lines
678 B
PHP
38 lines
678 B
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class DbCorrection extends CI_Controller
|
|
{
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('Admin_model');
|
|
}
|
|
|
|
function index()
|
|
{
|
|
//echo base_url();
|
|
|
|
$students = $this->db->query("SELECT id from students")->result_array();
|
|
$i=0;
|
|
foreach($students as $std)
|
|
{
|
|
|
|
|
|
$stdBatchDets = $this->db->query("SELECT * from student_batch where student_id = ".$std['id']." order by id DESC limit 1")->result_array();
|
|
if(isset($stdBatchDets[0]))
|
|
{
|
|
|
|
$this->db->insert('sb_temp', $stdBatchDets[0]);
|
|
}
|
|
else {
|
|
$i++;
|
|
}
|
|
|
|
|
|
}
|
|
echo $i;
|
|
exit;
|
|
}
|
|
} |