This all works except it doesn't show partial rows of records on the last page.
On the ELSE, $startPage=($page-1)5 if I change it to $startPage=$page5
then it paginates the numbers at the bottom starting from 1 (divided by the number of the LIMIT and the number of records). In this case the display really starts on page 0. IF you click any of the numbered pages then try to go back to page 1, page 1 displays, but you can't get back to page 0, which should really be page one and page 1 should be page 2.
If I change $p=1 to $p=0 in the FOR for the page numbers then it works on both ends but it is really weird because the user needs to start on page 0 instead of page 1.
thanks,
$result=mysql_query($sql);
$nRecs= mysql_num_rows($result);
if ( $page=='' ) {
$page=1;
$startPage=0;
}else{
$startPage=($page-1)*5;
}
$sqlLimit="LIMIT $startPage,5 ";
$sql .= $sqlOrder ." ". $sqlLimit ;
$result=mysql_query($sql);
$noPages=$nRecs/5;
$noPages=(int)$noPages ;
for ( $p=1;$p<=$noPages;$p++ ) {
echo "<a href='$me?page=$p&bu=$bu&zonenm=$searh_zonenm&zoneid=$search_zoneid'>$p</a>\n";