I always thought that LIMIT in a query selects only between numbers I set.
Suppose I have two columns to be selected with primary key – id. I have 90 rows.
SELECT name, lastname
FROM some_table
WHERE id = '123' LIMIT 0, 30
will select exactly 30 rows. Ok, but
SELECT name, lastname
FROM some_table
WHERE id = '123' LIMIT 30, 60
will select more than 30 rows. Well, I am doing this for AJAX paginator using PHP+mysql.
How can I do this right way?
limit is offset, rowcount. so it should be limit 30,30, not 30, 60, if you want 30 rows.