Mysqli Pagination link problem.
I have following code based on your tutorial on MYSQLI Numbered pagination:
<?php
$maxRows_Properties =4;
$Properties = new WA_MySQLi_RS("Properties",$con2,$maxRows_Properties);
$Properties->setQuery("SELECT * FROM Properties");
$Properties->execute();
?>
<?php
$PropertiesTotal = new WA_MySQLi_RS("PropertiesTotal",$con2);
$PropertiesTotal->setQuery("SELECT count(1) a FROM Properties");
$PropertiesTotal->execute();
$Properties_Total = (int)$PropertiesTotal->Results[0]['a'];
$Req_Pages = ceil($Properties_Total/$maxRows_Properties);
?>
<?php
$totalRows_Properties = $Properties_Total;
$pageNum_Properties = 0;
if (isset($_GET['page'])) {
$pageNum_Properties = $_GET['page'];
}
$incdone = false;
if ($maxRows_Properties == 0)
{
$maxRows_Properties =1;
$incdone = true;
}
$totalPages_Properties = ceil($totalRows_Properties/$maxRows_Properties)-1;
if($totalPages_Properties > 0 && !$incdone )
{
$elems = array();
for ($i=0;$i<$Req_Pages;$i++)
{
if ($i==$pageNum_Properties)
{
$elems[] = "<li><a class=\"current-page\" href=\"properties.php?page=$i\">".($i+1)."</a></li>";
}
else
{
$elems[] = "<li><a href=\"properties.php?page=$i\">".($i+1)."</a></li>";
}
}
echo implode(" ",$elems);
}
?>
I want to use properties.php?page=1 or 2 or 3 & so on rather than pageNum_Properties.
Numbering works. But results display ain't changing.