简体   繁体   English

MySQL PHP继续超越LIMIT的结果

[英]MySQL PHP Continue results beyond LIMIT

I require to output only 35 results per tab within a JQuery UI. 我要求在JQuery UI中每个选项卡只输出35个结果。

Each Tab shall represent a page of 35 results by increment. 每个标签应以增量表示35页结果的页面。

JQuery Tab UI示例

I am not entirely familiar with the use of LIMIT and thus far i cannot seem to understand the correct way to utilize its function to achieve my desired result perhaps solely within a degree of my urge to ensure efficiency but nonetheless i would like to learn about the possibilities. 我并不完全熟悉LIMIT的使用,到目前为止,我似乎无法理解利用其功能实现我想要的结果的正确方法,可能仅仅是在我确保效率的一定程度上,但我仍然想了解可能性。

I have a MySQL Query as follows: 我有一个MySQL查询如下:

 $sql13x = " SELECT * 
                FROM item_groups 
                    WHERE section_id='$item_sec_id' 
                    AND item_sub_sec_id='$item_sub_sec_id' 
                    ORDER BY item_id ASC LIMIT 35"; 

From this point i am able to acquire 35 results, but how do i commence beyond that? 从这一点来说,我能够获得35个结果,但我该如何开始呢? Baring in mind each 35 results is responsible for creating the tab as well as the div below holding the results. 记住每个35个结果负责创建选项卡以及保存结果的下面的div

Is there an ability to continue a query beyond where you stopped previously? 是否有能力继续查询以前停止的位置? Or do i have to make a count with PHP and resend the query removing the total number of results counted? 或者我是否必须使用PHP进行计数并重新发送查询以删除计算的结果总数?

Even though i could achieve the desired result, this is a query of the "right" way to achieve the result, either through efficiency and or dynamic ability. 尽管我可以达到预期的效果,但这是通过效率和/或动态能力来实现结果的“正确”方式的查询。 Also in general to learn if i am missing something. 一般来说,要知道我是否遗漏了什么。

Limit can take two arguments, the starting point and the total amount. 限制可以采用两个参数,起点和总量。 So for instance LIMIT 0,35 starts at the first record and returns 35 records. 因此,例如LIMIT 0,35从第一个记录开始并返回35个记录。 If you want records 36-70, do LIMIT 35,35. 如果您想要记录36-70,请执行LIMIT 35,35。 Then limit 70,35 and so on. 然后限制70,35等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM