<ho******@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
1. UserA issued a SELECT statement
2. UserB issued another SELECT statement
3. UserA issued FOUND_ROWS() and will get the wrong result??
how to handle this?
FOUND_ROWS() is supposed to be similar to LAST_INSERT_ID(), in that it gives
the correct answer in the context of a given connection, even if other
statements are being executed on different connections.
Try this experiment: open two command windows, and run the mysql shell in
each window. Execute a query in shell A that returns N rows. Then execute
a query in shell B that returns some different number of rows. Then go back
to shell A and execute "SELECT FOUND_ROWS();". It should return the value N
of the previous query you executed in that shell, even though another query
has been executed in the meantime in shell B.
Note that executing "SELECT FOUND_ROWS();" again always returns the answer
1, because that's how many rows were returned by "SELECT FOUND_ROWS();".
Regards,
Bill K.