Add pagination for PHP search and pagination for php search
Pagination is a method for browsing large amounts of data. Beginners often have no clue about this issue. Therefore, I wrote this article to explain it in detail, we strive to make friends who have read this article understand the principle and implementation methods of paging display.
All sample code is
Asp.net uses the background to generate html pagination directly. asp.net pagination
This example describes how to use asp.net to generate html pagination directly in the background. It is a practical function. Share it with you for your reference. The specific method is as follows:
1. Create a stored procedure:
ALTER procedure [dbo].[p_news_query]@Page intasbegi
Paging display is a very common way to browse and display large amounts of data, one of the most frequently handled events in Web programming. For the veteran of Web programming, writing this code is as natural as breathing, but for beginners, the problem is often not a clue, so specially write this article to explain the problem in detail.
First, the principle of pagination:
The so-called paging display, that is, the result set in the database for
There are many programs that discuss how to implement pagination on the web, and I'm here to introduce a new way to implement pagination, using stored procedures to implement pagination
Because this program is written earlier, at that time did not have SQL 7, each Varchar can only support 255 characters, so take a relatively stupid way, if you are interested, ple
1. Use the plug-in jquery. pagination. js. If this js file is not available, I can send it to you.First, reference jquery. pagination. js (split page js), with pagination.css (paging style css ).2. The page js Code isCopy codeThe Code is as follows: 3. The code in the page Copy codeThe Code is as follows: 4. The page background code isCopy codeThe Code is as follows:Protected int pcount = 0; // total number
Use AJAX to implement non-refreshing data pagination and ajax to refresh data pagination
Previously, when using Asp. Net, The GridView control was used. Although ugly, it is still very powerful. Here, we will show you a more powerful way-Using AJAX to retrieve data from the server directly without refreshing the page.
I. Implementation Process
Note: The following content is used on the server.
First, you mu
Php + ajax implements the method of refreshing pagination, ajax pagination. Php + ajax implements the method of refreshing new pages. This document describes how php + ajax implements the method of refreshing new pages. Share it with you for your reference. The specific implementation method is as follows: this is a php + ajax method to achieve no refreshing paging, ajax paging
The example in this article
Implementation of the GridView paging
Copy Code code as follows:
To join in the GridView
Implementing pagination
Allowpaging= "true"
One page of data 10 rows
Pagesize= "10"
Events that are triggered when paging
Onpageindexchanging= "Gvwdesignationname_pageindexchanging"
In server events
Copy Code code as follows:
Protectedvoid gvwdesignationname_pageindexchanging (object sender, Gridviewpageeventargs
The pagination function in php page form supports static addresses and ajax pages. Every time I encountered paging, I always had to write it on my own. I thought it was quite complicated. so I wrote a paging method based on the general principle and I would like to record it here. At present, this page supports static address separation. every time you encounter a page, you have to write it on your own. I think it is very complicated. Therefore, I wro
This article gives an example of how to use the CodeIgniter paging class pagination. Share to everyone for your reference, specific as follows:
Controller controller (application/controller/page.php file):
The Public Function index () {$this->load->model (' Home_model ', ', TRUE ');
$config = Array (); $config [' per_page '] = $this->per_page; The number of data displayed per page $current _page = intval ($this->input->get_post (' Per_page '
Web page Paging
Why paging is required.
I. Data-related causes
The data in a large number of queries is more time-consuming.
Second, enhance user experience needs
Users are more convenient to query and display the data he needs.
Common pagination: traditional pagination and drop-through-page mode.
The traditional way of paging, you can clear access to data information, such as how many data, how many page
Some days ago, I wrote continuous integration practices for small-scale product teams.After that, I have been busy with the Project. Today I finally have time to complete this article on the continuous integration of large-scale projects.
I. Basics of continuous integration
In typical software projects, the integration phase is generally at the end, so there are
In actual programming, you often need to display a large amount of data by PAGE, and provide a paging navigation bar for users to choose from. A formula for regular paging is concluded, which is concise and universal. Page number = (total number of records + number of records per page-1)/number of records per page note that the division here is division. For example, if the total number of records is 10 and five records are required to be displayed on each page, the number of pages is (10 + 5-1)
Page. php
CopyCode The Code is as follows:
/**** Generic PHP paging class. (Like Google style)** You only need to provide two parameters: the total number of records and the number of records displayed on each page. (Detailed instructions are provided ..)** You do not need to specify a URL.ProgramGenerate. It is convenient for querying results by page.** The form is submitted using the get method, which ensures that URL parameters are not lost in operations such as query and deletion.**/
C
Existing requirements need to implement the current page number in the middle display is the following format layout of pagination:
previous page x x x x x Next
Analysis:
1, the current page is not the first page to display the previous page button
2, the current page is not the last page to display the next page button
3, the middle of the number show relatively troublesome
For start numbers
Page.index > 3? page.index+2 > Page.totalpage? Page.totalpa
Tags: PNG win 4.0 = = window click code enum completeIn the previous article, we have completed the background processing of the pagination display and now proceed to the front-end processing. Expected display results: Because of different items, different database data parts, so we will be paged out part of the page to create a separate JSP pages: 12pageencoding= "UTF-8"%>3456789Ten One A - - the - - - + - + A at
- - - -
Other continuous delivery related articles: "Continuous delivery" series of articles DirectoryChapter III Continuous Integration 1. IntroductionThe goal of continuous integration is to keep the software in a working state2. Achieve continuous Integration 2.1. Preparatory wor
A year ago, Li Jian (Editor of the agile community on infoq Chinese site) proposed to write some practices and examples used in practical agile software development projects, so I decided to summarize my actual project and consulting experience. Since we have been working in the field of "continuous integration and release management", we will not spend any time thinking about the subject. We will only focus on co
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.