hEAD>
$ gpageSize = 50; / / The number of records displayed per page
$ hostname = "localhost"; // mysql server
$ dbuser = "root"; // username
$ dbpasswd = ""; // password
//Connect to the database
$ ID = mysql_connect ($ Hostname, $ DBUSER, $ dbpasswd) or Die ("Unable to connect the database server!");
// Select the database
$ db = mysql_select_db ("infoDB", $ ID) or Die ("Unable to connect the database!");
// Take the Customers table as an example, build a query string
$ query = "select * from ipinfo";
// Execute Query Strategy
$ rresult = mysql_query ($ query) or Die ("SQL: $ Query");
// $ PAGE Variable Timed the current displayed page
IF (! isset ($ page) $ Page = 1;
IF ($ PAGE == 0) $ Page = 1;
// Get the current query record number $ nnumrow
IF ($ NNUMROWS = mysql_num_rows ($ rresult)) <= 0)
{
Echo "
No record";
EXIT;
}
// Get the maximum number of page numbers MaxPage
$ MAXPAGE = (int) CEIL ($ nnumrow / $ gpageSize);
IF ((int) $ page> $ maxpage)
$ Page = $ MAXPAGE;
?>
echo Less Page page, Total $ MAXPAGE Page font>";?>> TD> | TD> TR> TABLE>
|