Pagination past limit in codeigniter -
the code listing below in function in message controller. want page have 5 records @ time on page. using pagination class in codeignuter have set limits meaning if page has 3 records in pagination link in view 1 shown e.g < 1 , not < 1 2. happens last page, if pages 8 shows 9 <... 8 9. missing
$data['message_available'] = $this->getcheckformessages(); $config["base_url"] = base_url() . "messages/inbox/"; $config['total_rows'] = $this->getmessagecount(); $config['per_page'] = 5; $config["num_links"] = 10; $config["full_tag_open"] = '<div id="pagination">'; $config["full_tag_close"] = '</div>'; $this->pagination->initialize($config); $data['messages'] = $this->getmessages($config['per_page'], $this->uri->segment(3)); $data['links'] = $this->pagination->create_links();
you have check :
$config['total_rows'] = $this->getmessagecount();
maybe returning field more results query getmessages();
please post getmessages()
, getmessagecount();
queries more accurated
also please change this:
$config["base_url"] = base_url() . "messages/inbox/";
to this:
$config["base_url"] = site_url('messages/inbox');
Comments
Post a Comment