the Pear DB Class
FileName:Pager.class.php
Pagination class, which is used only to work with data structures, and is not responsible for working with the display
Class Pager
{
var $PageSize; Number of pages per page
var $CurrentPageID; Current number of pages
var $NextPageID; Next page
var $PreviousPageID; Previous page
var $numPages; Total pages
var $numItems; Total number of records
var $isFirstPage; is the first page
var $isLastPage; is the last p
structure, not to handle the work displayed class Pager { var $PageSize;//number of per page var $CurrentPageID;//Current pages var $ next: Php to implement the first page automatically select the language jump ID;//Next page var $Previ Ouspageid; Previous Var $numPages//Total number of pages Var $numItems;//Total Records Var $isFirstPage//Whether first page Var $is previous page: XML-RPC for PHP and Java Solutions to Chinese problems; Wheth
process data structures and is not responsible for working with the display class Pager { var $PageSize; Number per page var $CurrentPageID;//Current Page var $NextPageID;//Next Var $PreviousPageID;//prev var $numPages;//Total Page var $numItems;//Total number of records Var $isFirstPage;//whether the first page Var $isLastPage;//whether the last page var $sql;//sql Query Statement
Function Pager
| ';}else{$page _string. = ' }if ($page = = $page _count) | | ($page _count = 0)) {$page _string. = ' next page | last ';}else{$page _string. = ' }Gets the data and returns the result in a two-dimensional array formatif ($amount) {$sql = "SELECT * from table ORDER BY id desc limit". ($page-1) * $page _size. ", $page _size";$result = mysql_query ($sql);while ($row = Mysql_fetch_row ($result)) {$rowset [] = $row;}}else{$rowset = Array ();}There is no code to display the results, which is not in t
.
3) set the size:
In the Bootstrap framework, you can also set the size in several different cases. Similar to buttons:
"Pagination-lg" is used to increase paging navigation;
Use pagination-sm to reduce the paging Navigation:
…
…
…
4) implementation principle of size setting:
In practice, the corresponding padding font-size and angular sizes are added. The source code is 4,193rd rows for the bootstrap.css
Front desk
Copy Code code as follows:
Paging class
Copy Code code as follows:
[Serializable]
public class Pager
{
public int totalrecords;
public int pageSize;
public int pageIndex;
public int totalpages;
}
After his code
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControl
database connection in the following code uses the pear db class for processing.
// FileName: Pager. class. php// Paging class. this class is only used to process the data structure and is not used to process the display.Class Pager{Var $ PageSize; // Number of pages per pageVar $ CurrentPageID; // Current page numberVar $ NextPageID; // Next pageVar $ PreviousPageID; // Previous PageVar $ numPages; // T
codeThe database connection in the following code uses the pear db class for processing.
// FileName: Pager. class. php// Paging class. this class is only used to process the data structure and is not used to process the display.Class Pager{Var $ PageSize; // Number of pages per pageVar $ CurrentPageID; // Current page numberVar $ NextPageID; // Next pageVar $ PreviousPageID; // Previous PageVar $ numPag
= $ amount/$ page_size; // if there is no remainder, the number of pages equals the total data volume divided by the result of each page
}
}
Else {
$ Page_count = 0;
}
// Flip link$ Page_string = '';If ($ page = 1 ){$ Page_string. = 'Page 1 | previous page | ';}Else {$ Page_string. = 'Page 1 | previous page | ';}If ($ page = $ page_count) | ($ page_count = 0 )){$ Page_string. = 'next page | last page ';}Else {$ Page_string. = 'next page | last page ';}// Obtain data and return results in two-d
command to mysql service help (\ h) Display this help. nopager (\ n) Disable pager, print to stdout. -- close the page settings and print it to the standard output notee (\ t) Don't write into outfile. -- disable pager (\ P) Set PAGER [to_pager]. print the query results via PAGER. -- set the
(\ G) Send command to mysql server, display resu Lt vertically. -- the control result is displayed as vertical exit (\ q) Exit mysql. same as quit. -- exit mysqlgo (\ g) Send command to mysql server. -- send the command to mysql service help (\ h) Display this help. nopager (\ n) Disable pager, print to stdout. -- close the page settings and print it to the standard output notee (\ t) Don't write into outfile. -- disable
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.