assume we have to collect data from 2 rows of a table
for example :
select * from table where userid=24
and it returns for example 3 rows of data with different id of row ( auto increment ) , 3 ,35 ,68
I want to know what’s the id of the row before the row with id 35 ( which is 3 ) of about 68 it is 35.
how can I find it by mysql queries?
thank you
Using mysql_insert_id()
Here is a reference to what you need
http://dev.mysql.com/doc/refman/5.5/en/getting-unique-id.html
EDITED
Perhaps you would like to use a query like this