pagination error - help |
[eluser]oliur[/eluser]
First link : http://localhost/kikorben/site/index 2nd link : http://localhost/kikorben/site/index/10 What I can see from the url is that the offset number is missing at the end in the first link and I think there is nothing wrong with that if you do a little modification in your model class modified code: Code: function getPost($perpage,$offset = 0) This should ensure the first page starts with an offset of 0 by default. The pagination is working now, as in all of my links are working fine except the first link. I still get that empty offset error message in the SQL for the first link. Quote:A Database Error Occurred I've also changed this line of code in my controller: Code: $page_details['post_rows'] = $this->post_model->getPost($config['per_page'], $this->uri->segment(3)); EDITED: THIS HAS SOLVED MY PROBLEM Code: function getPost($perPage,$offset = 0){ ANOTHER SOLUTION : I was going wrong in not checking for null values for the offset parameter. Code: function getPost($perPage,$offset = 0){ |
Messages In This Thread |
pagination error - help - by El Forum - 12-17-2009, 04:04 PM
pagination error - help - by El Forum - 12-17-2009, 05:22 PM
pagination error - help - by El Forum - 12-17-2009, 05:36 PM
pagination error - help - by El Forum - 12-17-2009, 06:31 PM
pagination error - help - by El Forum - 12-18-2009, 03:34 AM
|