[Mono-list] Num Rows

Lauri Kotilainen rytmis at gmail.com
Sun Apr 13 12:52:14 EDT 2008


Hi,

couple of notes:

On Sun, Apr 13, 2008 at 4:29 PM, Robert Jordan <robertj at gmx.net> wrote:
>  Execute the command "select FOUND_ROWS()" on the same connection.

Make sure you don't execute another query in between, or FOUND_ROWS()
will return the number of rows from that query instead.

>  Note that if your select is using "LIMIT", you must use the
>  SQL_CALC_FOUND_ROWS options:

Not necessarily: you may actually want the number of rows returned by
the query *with* the limit (e.g. FOUND_ROWS() for LIMIT 0,10 would
return *at most* 10, not the total number of rows before the limit).

But by and large that's the way to go. :)


-- 
Lauri Kotilainen
Email: rytmis at gmail.com


More information about the Mono-list mailing list