I'm using MySQL LIMIT to display 50 rows (pages) at a time, like so:
SELECT cols
FROM table
LIMIT 49, 50
What's the most efficient way for me to determine how many "pages" I have in my result set (how many total records my query is producing)?
Before I run the code above, should I just run a quick and dirty:
SELECT COUNT(cols)
FROM table
to determine the # of rows in my result set?
(This seems kind of inefficient to run 2 queries to do this)