Php paging simple php simple paging program _ php instance
The code is as follows:
User Information Summary
$ Pages) $ page = $ pages; if ($ _ GET <1) $ page = 1; if (! Ereg ("^ [0-9] + $", $ _ GET) $ page = 1; if ($ _ GET = "") $ page = 1; // calculate the record offset $ offset = $ pagesize * ($ page-1); // Retrieve record $ res = mysql_query ("select username, pass, mail, add_time from buyer order by add_time limit $ offset, $ pagesize ", $ db); // if ($ myrow = mysql_fetch_array ($ res )) {$ I = 0;?>
| |
User information management |
|
|
-------------------------------------------------------------
Total ". $ pages." page (". $ page."/". $ pages .")
"; // Display the number of page shards for ($ I = 1; $ I <$ page; $ I ++) echo" no ". $ I. "page"; echo "no ". $ page. "page"; for ($ I = $ page + 1; $ I <= $ pages; $ I ++) echo "no ". $ I. "page"; echo"
"; // Display to page echo" "; echo"
Serial Number |
User name |
Password |
Email |
Time added |
|
|
|
|
|
";}// Display the total number of pages echo"";?>
The above is the content of php simple paging program _ php instance. For more information, see PHP Chinese network (www.php1.cn )!