Welcome Guest, Not a member yet? Register   Sign In
Activerecord - getting totalnumber of query when limit is used
#11

[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 forums
This 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 go
This 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


Messages In This Thread
Activerecord - getting totalnumber of query when limit is used - by El Forum - 12-10-2007, 08:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB