Reputation: 139
I'm working on some charts and I need to find out how I can make my query skip x records on a select.
Lets say, I have 100 Records in my MySQL database.
and I want to select, but buypass 9, or skip 9 (whatever we should call it)..
so I'm selecting:
id 1
id 10
id 19 etc etc..
How am I able to do so in a query ?
I have tried to get the values in a for loop
by incrementing $i
with $offset (how many I want to bypass)
and then use the $data[$i]['value'];
but is was not able to get that to work.
Upvotes: 3
Views: 178
Reputation: 297
The Mysql LIMIT command allows you to skip (10) records, and return (50) records
SELECT *
FROM FOO
LIMIT 10, 50
Upvotes: -1