Php simple paging program Page 1/5 _ PHP Tutorial

Source: Internet
Author: User
Php simple paging program 15th page. [Code] htmlheadmetahttp-equivContent-Typectitle user information summary titlestyletypetextcss! -- Body, td, th {font-size: 14px;}. STYLE1 {font-size: 16px; color: #666666;} -- s [code]



User Information Summary




######################################## #####################
########### Connect to a database ################
######################################## #####################
$ Db = mysql_connect ("192.168.0.2", "root", "goalwe608"); // database, user name, password
Mysql_select_db ("86pos", $ db); // Database
############ Paging ############
// Set the number of records displayed on each page
$ Pagesize = 5;
// Retrieve the total number of records
$ Res = mysql_query ("select count (id) from buyer", $ db );
$ Myrow = mysql_fetch_array ($ res );
$ Numrows = $ myrow [0];
// Calculate the total number of pages
$ Pages = intval ($ numrows/$ pagesize );
If ($ numrows % $ pagesize)
$ Pages ++;
// Determine whether the page number is set or not. if not, the page number is defined as the homepage.
If (! Isset ($ page ))
$ Page = 1;

// Prevent malicious access
If ($ _ GET

Export html head metahttp-equiv = "Content-Type" c title user information summary/title styletype = "text/css "! -- Body, td, th {font-size: 14px;}. STYLE1 {font-size: 16px; color: #666666 ;}--/s...

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.