Activerecord - getting totalnumber of query when limit is used |
[eluser]WolfgangA[/eluser]
@ELRafael Quote:try to use $this->db->last_query()… maybe help you!Would this allow to modify the query to add start and limit for the 2nd run? @Zacharias Knudsen Quote:Have a search for “SQL_CALC_FOUND_ROWS” on the forumsThis will most likely not work in the active record class, because not all databases do support this. @barbazul Quote:running two queries IS the way to goThis is exactly what i try to avoid. I use the active record class to abstract the query from the native SQL. So i would have to construct the active record twice. Here a solution i come up with. Active Record extension It is not perfect and has room for improvements. But it works. Any comments are welcome. Regards Wolfgang |
Welcome Guest, Not a member yet? Register Sign In |