Hey,
It’s my first post here, though I’ve been lurking for a quite a while. I was hoping that someone may be able to help me out. I’m having trouble getting LIMIT/ORDER BY to work together. I’ve tried to research it on the net, and have read that first sql will Order your results and then LIMIT them (so it should work fine). But I can’t seem to get it to work.
I’m trying to order a group of results by price. All the results on the first page are ordered. However all results after the first 9 are not placed in the order at all.
Here is the Query:
$data = mysql_query(“SELECT SQL_CALC_FOUND_ROWS * FROM product_list WHERE name LIKE ‘%$find%’ OR size LIKE ‘%$find%’ OR brand LIKE ‘%$find%’ OR text LIKE ‘%$find%’ ORDER BY packageprice DESC LIMIT $startrow, 9”);
The variables are filled in via user input. Everything else works correctly-- accept for the ORDER BY.
Any suggestions or direction would be appreciated. Also if more of the code would help let me know.
Thanks in advance for any help you can offer.