builder question when using pagination |
I created a builder object and if I use the where function to restrict results, how do I get the total records for pagination links?
I seem to have to create two builder objects Code: $builder = $this->db->table('searchlogs'); I cannot use countAllResults with $builder as this kills the filter returned.
Please see the Pagination Documentation.
CodeIgniter $ Users Guide - Pagination - getPageCount() What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-29-2022, 12:35 AM)InsiteFX Wrote: Please see the Pagination Documentation. I got this working using the same builder object, I had to assign the where condition again and issue the countAllResults. I ended up putting it in a function to not repeat code.
Glad you got it working. I use the above code in the Pagination template to show ( Page 1 of 10 Total Pages ).
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |