BBnepal-Accounts/application/controllers/DbCorrection.php

38 lines
678 B
PHP
Raw Permalink Normal View History

2024-07-10 12:43:19 +00:00
<?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;
}
}