Paging Terminator

Source: Internet
Author: User
PHP code :--------------------------------------------------------------------------------
<?
/*
Bytes ------------------------------------------------------------------------------------
Class name: Lwgpagenum
Notes: PHP + MySQL paging class
Author: long Weiguo
Network user: lwg888
Email: lwg888@163.com
Use, modify, and disseminate author information
Bytes ------------------------------------------------------------------------------------
*/
Require_once (dirname (_ FILE _). "/Lwgdb. inc. php ");
// Lwgdb. inc. php is a database connection and SQL statement execution class.
Class Lwgpageturn {
// ---------- You can set the value variable ----------------------------------------
Var $ maxnum; // Number of Entries displayed per page
Var $ maxnum_max_size = 100; // The maximum number of entries displayed on each page. It is used to specify that $ maxnum cannot exceed $ maxnum_max_size.
Var $ SQL; // SQL statement
Var $ navchar = array ('[| <]', '[<]', '[>]', '[> |]', '[<]', '[>]');
// Display characters of the navigation bar. The value can be customized, such as an img tag.
// $ Navchar [0] indicates the first page, $ navchar [1] indicates the previous page, $ navchar [2] indicates the next page, and $ navchar [3] indicates the last page, $ navchar [4] indicates the first n pages, and $ navchar [5] indicates the last n pages.
Var $ key; // if a page contains multiple pages, it is marked as a difference.
Var $ debug = true; // whether to display debugging information

// ---------- The variable used to obtain the value ---------------------------------------
Var $ totalnum; // The total number of records
Var $ totalpage; // The total number of pages.
Var $ startnum; // The ordinal number of the first entry in the total number on this page
Var $ endnum; // The ordinal number of the last row in the total number on this page
Var $ pagenum; // The ordinal number of the total number of pages on the current page.
Var $ field; // A set of result Records
Var $ id; // The serial number of each record
Var $ linkhead; // url specified by the link and relevant parameters to be passed
Var $ err; // record the last error message

// Constructor.
// The $ maxnum parameter is used to specify how many records are displayed on each page. If $ maxnum is not specified, all records are displayed instead of pagination.
// If there are more than two pages on the same page, the $ key parameter is used as the differentiation mark. Otherwise, you do not need to specify
// Usage:
// $ Obj = new Lwgpagenum ('10 ');
// Or: $ obj = new Lwgpagenum ();

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.