I've built a simple article website which lists articles of different categories. I've even implemented a simple pagination system whereinwhich visitors can browse through article lists. The client however has another requirement. They want that when reading an article[not on an article listing page] - there should be a 'next article' and 'previous article' link that links to the next/previous article in the article list.
Consider that the listing can be sorted differently so the next and previous links for reading an individual article should also reflect accordingly how can this be implemented. Its kinda like mini pagination I believe.
Is it possible to get in a single sql query the next and previous rows especially when selecting a single tuple?