MYSQL query to fetch the neighbour rows along with the present(id) given condition
like
ID | BOOK |
--------------
1 | xyzbooks |
2 | pqrbooks |
3 | dnsaddds |
4 | dfbsakjf |
5 | dbsadbdd |
6 | tyrbooks |
7 | sfdffdsf |
8 | yuibooks |
I am on id 3 (dnsaddds which i could get from url) and i searched for books . Now I need to fetch the row data of 3rd row, and next and previous results of searched text (books)
RESULT EXPECTED is as follows
ID | BOOK | AUTHOR | DATE
---------------------------
2 | pqrbooks | fbsdjf | 2013
3 | dnsaddds | fdsfbs | 2012
6 | tyrbooks | fdsdff | 2011
Looking for a single query with out unions etc..