David19801
David19801

Reputation: 11448

select found rows mysql php code

I just found this on stack Getting single value from a single row with Mysql/PHP:

$result = end(mysql_fetch_array(mysql_query('SELECT FOUND_ROWS()', $db)));

I searched and could not find an easy to understand description on google.

Could somebody please explain select found_rows()?

What would $db possibly look like?

Does this return a particular value of a row or the entire row like select *?

Upvotes: 1

Views: 1275

Answers (1)

Delan Azabani
Delan Azabani

Reputation: 81384

$db is a MySQL connection handle. FOUND_ROWS() returns the total number of rows that would have been returned if the query didn't have a LIMIT clause, without re-running the query.

Upvotes: 1

Related Questions