Hi everyone,
Say I have a table with many rows, and I wanted to limit the query between rows 10,000 and 20,000 or 300 to 400, how would I change the LIMIT
part to reflect that?
LIMIT 10000, 20000
The fastest and litte complex way is to use Keyset Pagination:
https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/
Thank you both.
Quote from: vbgamer45 on June 11, 2018, 01:03:51 PM
LIMIT 10000, 20000
Are you sure this will give me 10000 rows? I.e. 20,000 - 10,000 =
10,000?
Please when I write
$count = mysql_num_rows($request); it gives me 20,000. I need the difference
No it doesn't it should be
LIMIT 10000, 10000
Since the first returns 20k records
Maybe I'm not communicating what I want very well.
I'll try again. Pretend I want rows between 30 and 40. In other words, I want 10 row output between row 30 and 40, would I use
LIMIT 30, 40? I tried that already and it didn't work.
seriously... google is your friend. :P
https://www.w3schools.com/php/php_mysql_select_limit.asp
Normally I use id's to return the rows i want rather than limit offsets. Limits i generally use with paging
Such as where id_msg >= 30 and id_msg <= 40
Quote from: vbgamer45 on June 13, 2018, 09:28:17 AM
Normally I use id's to return the rows i want rather than limit offsets. Limits i generally use with paging
Such as where id_msg >= 30 and id_msg <= 40
This works best for my needs, thanks for the idea.
That is always the most efficient way as well.