PHP Classes

File: sample1.txt

Recommend this page to a friend!
  Classes of Shiegege   Paging for MySQL   sample1.txt   Download  
File: sample1.txt
Role: Example script
Content type: text/plain
Description: Simple Sample
Class: Paging for MySQL
Create a query results page navigation bar
Author: By
Last change: Add url
Date: 20 years ago
Size: 533 bytes
 

Contents

Class file image Download
<?
// see online: http://kentung.f2o.org/scripts/paging/sample1.php
require("paging_class.php");

$paging=new paging(5,5);
$paging->db("localhost","username","password","dbname");
$paging->query("Select * FROM paging ORDER BY MY_FIELD ASC");

$page=$paging->print_info();
    echo
"Data $page[start] - $page[end] of $page[total] [Total $page[total_pages] Pages]<hr>\n";

while (
$result=$paging->result_assoc()) {
    echo
$paging->print_no()." : ";
    echo
"$result[MY_FIELD]<br>\n";
}

echo
"<hr>".$paging->print_link();
?>