I have the following php script and the next works perfect. However the previous only shows two different ones and then stops. I don't understand why. It's not showing all the previous products but all the nexts show up correctly. Any advice greatly appreciated.
// Get Previous link
$queryprevious = mysql_query("SELECT * FROM products_categories AS pc, products as p
WHERE pc.categoryid = '$catid'
AND pc.productid < '$productid'
AND pc.productid = p.productid
GROUP BY pc.categoryid
ORDER BY pc.productid DESC") or die(mysql_error());
$previousprod = mysql_fetch_array($queryprevious);
// Get next link
$querynextprod = mysql_query("SELECT * FROM products_categories AS pc, products as p
WHERE pc.categoryid = '$catid'
AND pc.productid > '$productid'
AND pc.productid = p.productid
GROUP BY pc.categoryid
ORDER BY pc.productid ASC
limit 1") or die(mysql_error());
$nextprod = mysql_fetch_array($querynextprod);