Hi
I have manged to get results from a database using "next" & "previous" buttons but say 20 records are shown - when i click the "next" button theres no more records to show ! and goes to a blank page.
So i need not to display the next button after the last record is shown - can anyone help me with this problem ?
The code i`m using is this:
$prevlimit=$limit-5;
if ($prevlimit<0) $prevlimit=0;
if ($limit > 4 )
echo "<a href=\"$_SERVER[PHP_SELF]?search=$search&limit=$prevlimit>previous 5</a>";
else
echo " ";
$nextlimit=$limit+5;
if ($limit < $no_of_records ) <------ (This is the problem line !)
echo "<a href=\"$_SERVER[PHP_SELF]?search=$search&limit=$nextlimit\">next 5</a>";
else
echo " ";
?>
Thanks
Lee