- SELECT * FROM book limit 0, 5;
- SELECT * FROM book limit 5, 5;
- SELECT * FROM book limit 10, 5;
Copy CodeThe first sentence is to find 5 information from the zero, the second is to start from 5 to find 5 information, the third does not have to say more. First 0 = (1-1), 5 = (2-1), 10 = (3-1) It is here to understand what is represented by the one-to-one, and 5 for what it can be. The current page, that is, the first, second, third page, and 5 is the number of records displayed. To derive the query formula:
- SELECT * FROM book limit ($pageval-1) * $pagesize, $pagesize;
Copy CodeHow to get the $page value. This is achieved using $_get (page). Specific steps: First, determine the number of output records $pagesize=5, the use of $url=$_srever["Request_uri"], to get the current URL, and then through the Parse_url () to resolve the URL, and finally the value of the path is taken out. This is the URL you want in the paging. PHP Paging Code: [Code]
|