grmph
The LIMIT function can get results in chunks.
LIMIT 0,10 will get the first 10 results,
LIMIT 10,10 will get the second,
LIMIT 20,10 will get the third etc.
in short:
LIMIT ($iPageNumber*$iPageLength),$iPageLength
Now all you have to do is find a way to get $iPageNumber and send it along in your query.
You can get the total number of pages by running the query without the LIMIT and counting the results:
SELECT count(*) AS cnt
FROM table
WHERE yourstuff=here
AND foo=bar
then devide the results by the pagelength and you have the total number of pages.
you can use a simple FOR loop to print the pagenumbers and make HTML links (a href) out of them so people can click it and thereby send the pagenumber to the query.
Any clearer now?
let me know.