Hi, I have the pages working fine although I want to be able to limit the numbers that are displayed, lets say there are 19 pages:
1 2 3 to 19
I just want to display:
1 2 3 4 5
then when you click 2:
2 3 4 5 6
and so on. Kinda like the phpbuilder forum. Anyway i've been trying to figure this out for ages with for loops all over the place but i'm getting results like:
1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8
which i guess isn't far off, but its displaying each set, i obviously only want the 1 2 3 4 5.
The for loop that i'm using to get the page numbers is:
$count = 1;
$new = 0;
$groups = ($numrows/16) + 1;
for($count=1; $count<$groups; $count++ . $new+=16)
{
if($new == $group)
{
echo " <a href='page.php?group=".$new."'>[".$count."]</a>";
}
else
{
echo " <a href=page.php?group=".$new."''>".$count."</a>";
}
}
$new and $group are the limit set in the SQL query.
Can anyone help me?
Thanks in advance.
Ant