Hi,
- Why use paging?
It's not really cool to print out all 2000 rows you have in a table to the page, so it'd be nice to page them.
Special cases?
Yeah, if you have 1000 rows.. and you've set the maximum row per page to 20, well.. you're gonna get 50 links for your pages.. so I took care of that. How? I only show the first costume number of page links, and the more you navigate, the more pages you'll see.
Parameters:
1- The maximum number of results you want in each page.
2- The maximum number of pages links you want in the page.
3- The query you've used to get your results.
4- The page that has your results.
Example (call the function in the place you want to put the page links)
<?php
pageThis(20, 10, "SELECT * FROM notes", notes.php);
?>