I know Rich responded to you with an option based on a story posted here at PHPBuilder, but there are some options in addition to that one as well.
Assuming you understand the code and you're not just going to copy the code that comes with the story, I'd say do something like .....
This is psuedo code
$retid = mysql_query_db("Your query");
$howmany = mysql_get_rows($retid);
Now update your query to limit the first ten results
$your_query = $your_query." limit 0, 10";
Now, when the person clicks on the next button at the bottom of the page, you just update that limit statement in you query. The second page would look like...
$your_query = $your_query." limit 10, 10";
All the while, you use the info from $howmany to figure in the beginning how many pages you will need at 10 results per page (a simple matter of division), and of course how many results the last page will show. If you have 67 results from a query, then the query for the last page may something like...
$your_query = $your_query." limit 60, 7";
Now the reason I like this way better than the option provided by the tutorial is becuase there is a lot less tweaking of the query statement. Doing it this way, I just tack the limit statement on the end of the query as opposed to didling around with the count() stuff. It's especially problematic when you're dealing with dynamic generation of query statements.
Anyways, I know you wanted to code, but I hope this helps you think about HOW this works. That's what makes us all better developers.
Later on,
Big Din K.R.