Buchead Posted August 26, 2006 Share Posted August 26, 2006 Hello,Wondering if anyone can point me in the right direction. I have the following command:"SELECT * FROM products_tree, products WHERE products_tree.sectionID = '$section' AND products.productID = products_tree.productID AND products.keywords LIKE '%$search%'"It works ok. Checks the products_tree table for the given section number, and then retrieves the relevant data from products for the given productID and the keywords match the criteria. However I'd like to order the output by products.code as it's simply outputting in the order retrieve from the database.I've added in an ORDER BY clause but that had no effect.What am I doing wrong?Thanks,Clive. Quote Link to comment Share on other sites More sharing options...
helpmeplease2 Posted August 26, 2006 Share Posted August 26, 2006 try putting the ORDER BY at the end, so right after '%$search%'. I've noticed it doesn't always work when its at other spots. Quote Link to comment Share on other sites More sharing options...
Buchead Posted August 27, 2006 Author Share Posted August 27, 2006 Thanks. Realised what I was doing wrong. Had 2 sql queries and I'd filled in the wrong one. Completely down to user error! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.