I executed the following query on the local system
SELECT FOUND_ROWS() FROM table_name LIMIT 1; SQL Version : 5.6.16
It returns the number of rows.
when the same query is launched on the server (SQL Version: 5.7.17), it returns 0.
After searching the Internet, people are advised to use
SQL_CALC_FOUND_ROWS
so I use the following query on both local and server.
SELECT SQL_CALC_FOUND_ROWS * FROM users SELECT FOUND_ROWS();
But the results are the same, it works fine on the local (SQL version: 5.8.16) and returns 0 on the server (SQL version: 5.7.17).
source share