Domanda

I require to output only 35 results per tab within a JQuery UI.

Each Tab shall represent a page of 35 results by increment.

JQuery Tab UI Example

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.

I have a MySQL Query as follows:

 $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? Baring in mind each 35 results is responsible for creating the tab as well as the div below holding the results.

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?

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.

È stato utile?

Soluzione

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. If you want records 36-70, do LIMIT 35,35. Then limit 70,35 and so on.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top