mysql paging query problem



Example: There are 10 records in the commodity table, and now it needs to be displayed in pagination, and each page displays 3 records of data. Now we need to look at the data on the second page. Then the sql statement that should be used is:
select * from product limit 3[(2-1)*3],3;
there are two parameters after it. The first parameter [value: (the number of pages to be viewed - 1) multiplied by the second parameter] is the starting position, and the second parameter is the number of items to be displayed on each page.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326165447&siteId=291194637