[eluser]junaids[/eluser]
I have a little problem with pagination. when i click on the next link, the same records are shown every time
here my controler
Code:
function home($row=0)
{
$config['base_url'] = 'http://localhost/codeigniter/index.php/events/home/';
$config['total_rows']=$this->eventsmodel->getNumEvents();
$config['per_page'] = '5';
$this->pagination->initialize($config);
$data['css'] = $this->css;
$data['base'] = $this->base;
$allevents = $this->eventsmodel->getallEvents($row=0);
$data['events'] = $allevents;
$data['links']=$this->pagination->create_links();
$this->load->view('events/home', $data);
}
and model
Code:
function getallEvents($row) {
$Q = $this->db->get('event',5,$row);
if ($Q->num_rows() > 0) {
return $Q->result();
} else {
return FALSE;
}
}