undefined table data, pagination related - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: undefined table data, pagination related (/showthread.php?tid=52077) |
undefined table data, pagination related - El Forum - 05-29-2012 [eluser]zgames[/eluser] I'm trying to get users only with gender M, however pagination is trying to get all the values, therefore when the value is not equal it gives me this error, other wise everything is working perfectly fine could someone give me advice how to solve this problem? my model Code: function list_all(){ my controller Code: $puslapiai = $this->Puslapiai_model->get_paged_list('M', $this->limit, $offset)->result(); undefined table data, pagination related - El Forum - 05-29-2012 [eluser]zgames[/eluser] bump undefined table data, pagination related - El Forum - 05-29-2012 [eluser]CroNiX[/eluser] If you are using a where in your query to get the results, you need to use the same where when you are getting the count. lets say you had 50 males and 50 females. If you query to get males, you get 50, but your count function is still returning 100 because you don't have the same where (only males) in it. undefined table data, pagination related - El Forum - 05-29-2012 [eluser]zgames[/eluser] Code: function count_all($gender){ thanks for solution |