FOUND_ROWS()
FOUND_ROWS()
A select statement with limit clause is used to restrict the number of row returns. But if we want to know number of rows from the select query , we can use found_rows() function.To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:
Syntax:
SELECT SQL_CALC_FOUND_ROWS * FROM [tbl_name] WHERE [condition] LIMIT [limit]
SELECT FOUND_ROWS();
Example:
SELECT SQL_CALC_FOUND_ROWS * from wordlist where keyword like ‘%key%’ limit 10;
SELECT FOUND_ROWS();
