Get a query with a limit and offset and see if a result belongs to that - 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: Get a query with a limit and offset and see if a result belongs to that (/showthread.php?tid=52211) |
Get a query with a limit and offset and see if a result belongs to that - El Forum - 06-01-2012 [eluser]FabioAntunes[/eluser] Hi there I'm struggling here with this little problem. I have a pagination that shows 10 results each time,(10 student classes), what I want to do is instead of beginning in page 1 show as default the page that somewhere in that 10 results has the id of a student class. Code: $idClassRoom= 100; I hope I made myself clear Get a query with a limit and offset and see if a result belongs to that - El Forum - 06-01-2012 [eluser]weboap[/eluser] check this tutorial for a CI pagination example http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-7-pagination/ Get a query with a limit and offset and see if a result belongs to that - El Forum - 06-02-2012 [eluser]FabioAntunes[/eluser] [quote author="weboap" date="1338576162"]check this tutorial for a CI pagination example http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-7-pagination/ [/quote] But I already have a pagination working, that didn't help nothing at all. I just want to know if there's a way to "query a query" with active records: I'll try to explain myself again, I have this query wich has a limit of 10 results Code: $this->db->start_cache(); And I cached it, so i can apply the limit and after applying the limit I want to verify if in that 10 results I limited there is the idClassroom I wanted I can solve the problem this way Code: $this->db->start_cache(); I just want to know if there's a better way. |