in reply to Re: Re: mysql auto_incremented id
in thread mysql auto_incremented id
For example to get the next row in the sequence:
An alternative, with MySQL, is to use the LIMIT keyword. IIRC this should work (note - I'm not a MySQL specialist, so check for correct syntax):select ... from the_table where id = (select min(id) from the_table where id > $last_id)
As you are limiting the result set to a single row, and will get next row in the sequence even if there are gaps.select ... from the_table where id > $last_id order by id LIMIT 1
Michael
|
|---|