[eluser]Sathishkumar[/eluser]
Latest Controller :
Code:
$config['base_url'] = base_url().'index.php/student_submit/index';
$config['total_rows'] = count($this->excute->get_course2());
$config['per_page'] = '5'; //,$this->uri->segment(3);
$perpage = $config['per_page'];
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
$ddata['stu_id'] = $this->input->post('stu_id');
$username = $ddata['stu_id'];
$ddata['course'] = $this->excute->get_course2($perpage,$this->uri->segment(3));
$this->load->view('student_submit',$ddata);
Model :
Code:
function get_course2($perpage,$start='0')
{
$this->load->database();
$this->load->library('pagination');
$query = $this->db->query("SELECT * FROM course WHERE course_no_of_seats > course_enroll_no LIMIT $start , $perpage");
$total_rows=$query->num_rows();
if($total_rows>0)
{
foreach($query->result_array() as $row)
{
$result[] = $row;
}
return $result;
}
else
return 'null';
}