hope it helps
and its called pagination do a search in this forum there are plenty more examples
<?php
$table='test';
require("connect.php");
$query1="SELECT count(id) FROM ".$table;
$sql1=mysql_query($query1);
$count=mysql_result($sql1,0);
$lines=10;
// grab start position
if(isset($_GET['next']) && is_numeric($_GET['next']))
{
$start=$_GET['next'];
}
elseif(isset($_GET['pre']) && is_numeric($_GET['pre']))
{
$start=$_GET['pre'];
}else{
$start=0;
}
$hold=$start;
if($start>$count-$lines)
{
$start=$count-$lines;
}
if($start<0)
{
$start=0;
}
// loop through array from next
$query="SELECT * FROM ".$table." ORDER BY id LIMIT ".$start.",".$lines;
$sql=mysql_query($query);
while($row=mysql_fetch_assoc($sql))
{
echo $row['id']."<br>";
}
//display next previous
if($start>0)
{
$pre=$hold-$lines;
echo"<a href=\"".$_SERVER['PHP_SELF']."?pre=".$pre."\" >Previous</a> ";
}
if($start<$count-$lines)
{
$nex=$hold+$lines;
echo"<a href=\"".$_SERVER['PHP_SELF']."?next=".$nex."\" >Next</a> ";
}
?>