Use the offset and limit functions. First you need to count the rows so you can determine how many pages there will be.
//set offset if there is none
if(!$offset){
$offset= "0";
}
//count the records
$res = mysql_query( "SELECT count() from $dbtable");
$records = mysql_result($res,0,"count()");
//now do the select function with a limit and offset!
$result = mysql_query(SELECT * FROM $dbtable LIMIT $offset,20);
while ($row = mysql_fetch_row($result)){
echo "row[0]";
echo "row[1]"}
//this will return the first 20 results from the database.
now all you need to do is you make it so that if the number of results left to show is greater than 20....add another link:
//find # of results left to show
$results = "".($records-$offset)."";
if($results < 10){
//do nothing
}
else{
echo ("<a href='$PHP_SELF?offset=".($offset+20)."'>NEXT 20</a>");
}
if($offset !=0){
echo ("<a href='a$PHP_SELF?offset=".($offset-20)."'>PREVIOUS</a>");
}
or something to that effect!
HTH
scott d~