>> It works but I feel that its not an efficient way...could increase the processing speed though I am not sure
As always, i suggest for this 'Helper' Class which you can use it for any pages(nicely explained):
http://www.phpnoise.com/tu
There are also other pagination links:
http://www.tonymarston.net
http://codewalkers.com/cod
http://www.designplace.org
Main Topics
Browse All Topics





by: rstorey2079Posted on 2004-08-23 at 12:22:34ID: 11874090
Here's a bit of code that may help you out. This doesn't get into displaying 1 2 3 4 5 but it will point you in the right direction. To display all the available pages, you'd have to get the total number of results and then just calculate how many pages there will be and display the links.
).",".(($p ageID+1)*$ numItemsPe rPage);
$pageID+1. '>Next page</a>";
<?php
if($_URL['pageID']=="") {
$pageID = 1;
}
$numItemsPerPage = 5;
$sql = "SELECT * FROM stuff LIMIT " .($pageID*$numItemsPerPage
//run the sql
//output your results
echo "<a href='myPage.php?pageID=".
?>