CodeIgniter Forums
Pagination Problem Help me ... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Pagination Problem Help me ... (/showthread.php?tid=25751)

Pages: 1 2


Pagination Problem Help me ... - El Forum - 12-23-2009

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



Pagination Problem Help me ... - El Forum - 12-23-2009

[eluser]saidai jagan[/eluser]
Code:
$perpage = 5 // Set per page values
if($this->uri->segment(3)) // check for the start values
  $start = $this->uri->segment(3);
else
$start = 0;
$data['course'] = $this->excute->get_course2($perpage,$start);



Pagination Problem Help me ... - El Forum - 12-23-2009

[eluser]Sathishkumar[/eluser]
error ...

http://i49.tinypic.com/10xevqg.jpg


Pagination Problem Help me ... - El Forum - 12-23-2009

[eluser]saidai jagan[/eluser]
Code:
$perpage = '5' // Set per page values
if($this->uri->segment(3)) // check for the start values
  $start = $this->uri->segment(3);
else
$start = '0';
$data['course'] = $this->excute->get_course2($perpage,$start);
[/quote]