I need a way to grab "the next row" from a table in a mysql database. The table has an index that auto increments, but some of the rows may be deleted. So, for instance, the table might look like this:
To get the first row, I believe I can go:
SELECT columns FROM table ORDER BY index LIMIT 1
That should give me the first row, right?
But after this, I'm not sure what to do. Say I've read the first row up to the second (index = 4), how do I then get the next row? ("the next row" being the third row with index = 6).