![]() |
No results when paginate (WHERE something=$something) - 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: No results when paginate (WHERE something=$something) (/showthread.php?tid=1836) |
No results when paginate (WHERE something=$something) - El Forum - 06-29-2007 [eluser]Gabriel P[/eluser] Hello, I wish to grab some articles from db WHERE parentid=$catid. The thing is i want to paginate them. So, i believe i did not write the correct code. Here is my function from the controller: Code: function showArtByCat($catid) Could somebody help me? I think i`m tired and i can`t figure it out. Thanks, Gabriel No results when paginate (WHERE something=$something) - El Forum - 07-04-2007 [eluser]Phil Sturgeon[/eluser] Well you are not accepting the offset value in the controller if I understand you correctly. You are referencing segment 3 but it seems a little odd. Here's how mine works: Code: function index($limit = 25, $offset = 0) Yours would be no different, simply add in your count with a WHERE and add an extra $catID to the start of the controller param list. |