There is a mysql query.
suppose :
select primary_field, field2 from mytable order by field2
field2 is not unique.
now in the result if i have a record having values ( 536, any_value ).
I want to get the offset (position of the record in the result) .
infact i need it to get the next and previous record of the current record.
i dont want to fetch all records and then process it in php to get next and previous record.
i want to get it done in mysql query. is it possible in mysql query ?
Well, yes and no. If you have the result, then it may not be possible to retrieve the specific row if it is non-unique. But, if you simply want to get the row number:
Oh, and credit where credit is due.