Hi,
I am displaying a list.
The user can edit any item.
I am displaying next previous buttons which when clicked it dynamically fetches the next previous records form db. no page reload.
this is working well with id. like http://stackoverflow.com/questions/3780642/how-can-i-get-next-and-previous-field-id-with-php-from-mysql and http://stackoverflow.com/questions/528806/mysql-next-previous-ids-arbitrary-sort-order
Currently i am displaying like
select * from table order by name asc
and for next and previous i used like this...
select * from table where id > $id order by name asc limit 1
select * from table where id < $id order by name desc limit 1
the above is what i got when i searched the internet.
in this order the id will not be in an order so i cannot use id to fetch next and previous record i think so.
i want to get next and previous records with respect to any other field and not by id.
so some thing like this.
select * from table where id > 5 order by name asc or desc limit 1.
what would be the query?
Note
There are 15000 records. which is half filled by default. the rest half is supposed to be updated by admin. so instead of reloading the page after the admin had updated one record i fetch the other and show dynamically on the screen so that he can continue updating content. there will not any page reload. he just clicks update and the next record appears. he can select previous or next button to navigate between records.