Let me give you an idea: use a feature of MySQL to realize paging display of MySQL query results_PHP tutorial

WBOY
Release: 2016-07-13 11:00:03
Original
904 people have browsed it

In mysql, you can easily paginate query results by using a feature of the select statement. The syntax of the select statement:
SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [HIGH_PRIORITY]
[DISTINCT | DISTINCTROW | ALL ]
select_expression,...
[INTO OUTFILE 'file_name' export_options]
[FROM table_references
][WHERE where_definition]
[GROUP BY col_name,...]
 [ HAVING where_definition]
[ORDER BY {unsigned_integer | col_name | formula} ][ASC | DESC] ,...]
[LIMIT ][offset,] rows]
[PROCEDURE procedure_name] ]
The LIMIT clause can be used to limit the amount of data returned by the SELECT statement. It has one or two parameters. If two parameters are given, the first parameter specifies the position of the first row returned in all data. , starting from 0 (note not 1), the second parameter specifies the maximum number of returned rows
. For example:
select * from table LIMIT 5,10; #Return the 6-15 rows of data
select * from table LIMIT 5; #Return the first 5 rows
select * from table LIMIT 0,5; # Return the first 5 rows

http://www.bkjia.com/PHPjc/631839.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631839.htmlTechArticleUsing a feature of the select statement in mysql, you can easily achieve paging of query results. The syntax of the select statement : SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [H...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template