2

I have the following syntax, and all runs fine except for "LIMIT". All the results of the database display when only 9 results should. I have the "0, 9" coming from variables so they will change on each paginated link (ex. 0, 9; 10, 18; 19, 27; etc.). I checked and rechecked my syntax and I don't understand why all the results would show. Below is the exact query I'm testing.

Also to note, I'm using XAMPP

FROM acb_accfitems WHERE itemtype = 'furniture' ORDER BY price DESC LIMIT 0, 9
4

2 回答 2

2

这样你就可以进行分页:

ORDER BY price LIMIT 10       /* first 10 */
ORDER BY price LIMIT 11, 10   /* second 10 */
ORDER BY price LIMIT 21, 10   /* third 10 */

等等

于 2012-11-03T20:14:51.757 回答
0

ORDER BY price DESC LIMIT 9

Is what you need.

于 2012-11-03T20:08:55.187 回答