2011-09-09, 02:27 PM
In short my code works fine if nothing is set other than the page, but if the data is being sorted, it multiplies the page number by 10 for some odd reason. The various url variables are defined based off the current url. The strange thing is that the number it displays is correct, but the link is not when something is set. It correctly counts the number of pages there are.
$query = mysql_query($query);
$q2 = mysql_query($q2);
$rowcount = mysql_num_rows($q2);
$pagecount = ceil ($rowcount / 100);
$previouspage=$page - 1;
$pageloop = 1;
$currentpage = 1;
if ($page!=1)
{
$previous = "<a href='/members/pokedex.php?page=$previouspage" . $shinyurl . $sorturl . $staturl . $regionurl . $filterurl . "'>$previouspage</a> ";
}
while ($pageloop<$pagecount)
{
$nextpage=$pageloop+1;
$url = $nextpage . $shinyurl . $sorturl . $staturl . $regionurl . $filterurl;
$next .= "<a href='/members/pokedex.php?page=$url'>$nextpage</a> ";
$pageloop++;
}