Simple use of php thanks to a paging function module, php paging function module _ PHP Tutorial

Source: Internet
Author: User
Simple use of php thanks to a paging function module, php paging function module. Simple use of php thanks to a paging function module, php paging function module first paste a picture to see the effect in the code, right? Php $ localhostlocalhost; $ usernameroot; $ pa simple use of php thanks to a paging function module, php paging function module

First paste a picture to see the effect

Paste the code.

 Small module of PHP paging code

"; Echo" "; Echo" "; While ($ row = mysql_fetch_assoc ($ result) {$ id = $ row ['id']; $ name = $ row ['name']; echo" ";} Echo"
ID NAME
". $ Id ." ". $ Name ."
"; // 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 ~

First, paste a picture to see if the effect is on the code? Php $ localhost = "localhost"; $ username = "root"; $ pa...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.