The basics of it...
IF (empty($max)) $max="0";
$query="SELECT * FROM db LIMIT $max, 5";
while($row=mysql_fetch_array($result0)) {
$name = $row[name];
print "$name<br>";
}
$more=$max+5;
$less=$max-5;
print "<br><a href=\"page.php?max=$less\">PREVIOUS 5</a>";
print "<a href=\"page.php?max=$more\">NEXT 5</a>";
Where the first int after LIMIT is what result row to start at, and the second is how many to display.