in the following code , i am trying to display 10 products detail on one page and then other products detail on next page. the problem is when i am clicking the page 2 link in the bottom , it gives error message that " please select the category". please help me where is the problem in my code.
$SQLstring = "SELECT product_id FROM products LIMIT $offset,$rowsperpage";
echo "<table border='1' width=500 ><tr><th>Product ID</th>tr>";
while ($Row = mysqli_fetch_assoc($QueryResult))
{
$productid = $Row['product_id'];
echo "<tr><td>$productid</td></tr>";
}
echo "</table>";
$range = 3;
if ($currentpage > 1)
{
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a> ";
$prevpage = $currentpage - 1;
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a> ";
}
for ($x = ($currentpage - $range);$x < (($currentpage + $range) + 1); $x++)
{
if (($x > 0) && ($x <= $totalpages))
{
if ($x == $currentpage)
{
echo " [<b>$x</b>] ";
}
else
{
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> ";
}}}
mysqli_close($DBConnect);
}