SELECT * FROM ...LIMIT 5, 10
But what if I need full lines? I do not want to make another request without restriction. I just want this one query to return full rows if I didn't put a LIMIT there.
only way: (use 2 queries):
SELECT SQL_CALC_FOUND_ROWS ..... FROM table WHERE ... LIMIT 5, 10;
and immediately after launch:
SELECT FOUND_ROWS();
more details:
http://www.arraystudio.com/as-workshop/mysql-get-total-number-of-rows-when-using-limit.html
http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
Using
select count (*) from table_name