commitall
This commit is contained in:
38
application/controllers/DbCorrection.php
Normal file
38
application/controllers/DbCorrection.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user