Hi, here's a function I wrote for a site, which browses throught categories and prints all business in those categories. I've modified it a bit to try not to confuse you, but work your way through and it should help. Its PHP and HTML mixed up.
The page requires a $page to be passed, so initially this will be 1.
Basically, you need to use the MySQL LIMIT function.
There are 2 queries. First count how many in your query, then select your records.
HTML to print the records.
Then a footer with next, previous and page links. e.g. [previous][1][2][3][next]
The mysql queries are functions in a library, so you may have to change those.
Good luck
Function PrintImageList($page)
{
$totperpage = 10;
$cid = db_query("
SELECT count(*)
FROM table");
$tot = db_fetch_row($cid);
$totalincat = $tot[0];
$startrange = (($page-1) * $totperpage);
$qid = db_query("
SELECT fields
FROM table
ORDER BY field_name
LIMIT $startrange, $totperpage ");
$x = ($page-1)*$totperpage;
print "<TR><TD>";
print "<TABLE>";
while ($r = db_fetch_object($qid)) {
$x++;
print"<TR height='25' valign='bottom'><TD width='20'>";
pv($x);
print".</TD><TD align='left'>";
print"<A href='yourpage.php'>";
Image Code Here
print "</A>";
print"</TD></TR>";
}
if ($totalincat>0) {
print"<TR height='25' valign='bottom'><TD width='20'> ";
print"</TD><TD align='left' class=pagenav><B><FONT color='#000000'>Result Pages:</FONT></B>";
print " ";
print " ";
if ($page > 1) {
print "[";
print"<A class=pagenav href='yourpage.php?page=";
$prev = $page-1;
print $prev;
print "'>";
print"<<prev";
print"</A>";
print"]";
}
$totalpages = ceil($totalincat / $totperpage);
for ($loop = 1; ;$loop++) {
if ($loop > $totalpages) {
break;}
if ($loop == $page) {
print " ";
print $loop;
print " ";}
else {
print " ";
print"<A class=pagenav href='yourpage.php?page=$loop'>";
print $loop;
print"</A>";
print " ";
}
}
if ($page <> $totalpages) {
print "[";
print"<A class=pagenav href='yourpage.php?page=";
$next = $page+1;
print $next;
print "'>";
print">>next";
print"</A>";
print"]";
}
print "</TD></TR>";
}
print "</TABLE>";
print "</TD></TR>";
}