Simple use of php thanks to a paging function module first paste a picture to see the effect & nbsp; paste the code & lt ;? Php $ localhostlocalhost; $ usernameroot; $ passwordroot; $ dbtest; information $ simple use of php thanks to a paging function module
First paste a picture to see the effect
Paste the code.
Small module of PHP paging code"; Echo"
"; Echo"
| ID |
NAME |
"; While ($ row = mysql_fetch_assoc ($ result) {$ id = $ row ['id']; $ name = $ row ['name']; echo"
| ". $ Id ." |
". $ Name ." |
";} Echo"
"; // Previous page, next page $ pageprev = $ page-1; if ($ page >$ total) {$ pagenext = $ total ;} else {$ pagenext = $ page + 1;} // Link jump; echo "$ pageprev} '> Previous page else $ pagenext}'> next page"; mysql_free_result ($ result ); mysql_close ($ conn);?>
Key points: 1. $ SQL = "select * from page order by id limit {$ offset}, {$ pagesize }";
2. echo "$ pageprev} '> Previous Page Upload $ pagenext}'> next page ";
These two points are the key points that reflect the paging technology and php Code art ~
Learn with everyone ~