A very useful feature that MySQL provides is the ability to calculate the number of rows returned when using limit.
By using the SELECT parameter SQL_CALC_FOUND_ROWS in your first query and then in the next query use SELECT FOUND_ROWS(); function which will return the number of rows.
SELECT SQL_CALC_FOUND_ROWS col_a, col_b FROM tbl_name WHERE col_c = 8 LIMIT 10; SELECT FOUND_ROWS();


