Declare a $pagenum variable. Set it to 1 if it is not passed in as a form value.
in your SQL query, add:
$SqlQuery = "SELECT FROM blahblah WHERE ...where clause... LIMIT " . ($pagenum - 1)10 . ",10";
Then run another query to figure out total possible results:
$SqlQuery2 = "SELECT count(a_column) FROM blahblah WHERE ...same where clause...";
$count = RunQuery($SqlQuery2); // RunQuery is a random function name i made up
This will get you the total results. Then run a for loop to print out page numbers:
print "Page: ";
for($i = 0; $i < ceil($count/10); $i++) {
print "<a href=\"search.php?query=" . $query . "&pagenum=" . ($i+1) . "\">" . ($i+1) . "</a> ";
}
basically, $query is the query they searched for that is passed in again so the search will work.
let me know if you need to see a full PHP code,
-sridhar