Three parameters: the result of mysql_query(), the url variable page, the number of records per page you want
*/< /p>
class mysql_pager {
// define properties
var $page;
var $result;
var $results_per_page = 3;
var $total_pages;
/*
Define the methods
The following is the constructor, which has the same name as the class (>php4). It needs to query the result handle, the current page number, and the number of records per page
like: $f->mysql_pager( $result, 1, 15);
*/
function mysql_pager( $result, $current_page, $results_per_page ) {
if(!$result){
echo "
The database is not running, the result set is wrong
$p = new mysql_pager( $result, $page=$_GET["page"], 10 );
$p->print_navigation();
$p-> ;print_paged_results();
$p->print_navigation();
*/
?>
Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn