I'm trying to create a couple of links that displays the next/previous entry.
I understand that if I am do do this in simplest form, I would do something like the following (to create a NEXT link):
SELECT *
FROM Products
WHERE prodID > '$ID'
LIMIT 1
$ID is the current prodID that is being displayed. However, my query is a little more complicated. I need to order my results by type. Simply adding "ORDER BY type" will not work since the WHERE clauses gives us a references point on where to start looking for the results. If I keep the WHERE clause, it will sort the results by prodID which is throwing off the order.
Any ideas on how to fix this?