I whipped up some code to count the number of rows from my database, and through a little script, display “Page : 1 2 3 4 5” etc.
Here is my code:
$totalRows = mysql_num_rows
$rpp = 20
$totalPages = ceil($totalRows/$rpp);
$i;
for (i=0; i<totalPages; i++){
echo "Page: " . "<a href='index.php?page=\"$i\"rpp=20>\"$i\"</a>";
}
Does this look good? Do I need anything else?
EDIT 1: Added ceil() to round up. No more missing results :-)!
I think you need to round $totalPages to the next highest integer, ie.
$totalPages = ceil($totalRows/$rpp);