BBnepal-Accounts/application/controllers/DbCorrection.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

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;
}
}