Silverado_NL Posted February 2, 2007 Share Posted February 2, 2007 hi everybody, i always come here when im in trouble, and it has been a long while ago. anyways i just upgraded to Mysql v5.0 and now a query isnt working. i had other problems with the upgrade and managed to circumvent them, its just this issue i cant solve. does anybody else know what is wrong??? this is the error on the web page -------------------------------------------------------------------------------------------------------------------------------- SELECT DISTINCT cp.channel_productdata_id, cp.partner_product_id, cp.medium_id, cp.image, cp.beschrijving,cp.actief, cp.homepage, product.product_id, product.product_naam, merk.naam as merk, product.actief as product_actief, product.klein_image FROM channel_productdata AS cp INNER JOIN partner_product ON partner_product.partner_product_id=cp.partner_product_id INNER JOIN product ON product.product_id=partner_product.product_id INNER JOIN merk ON merk.merk_id=product.merk_id WHERE cp.partner_channel_id='51' ORDER BY channel_productdata_id DESC AND cp.channelHomepage='1' LIMIT 1 Query error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND cp.channelHomepage='1' LIMIT 1' at line 7 -------------------------------------------------------------------------------------------------------------------------------- this is the actual query -------------------------------------------------------------------------------------------------------------------------------- $productset_query = "SELECT DISTINCT cp.channel_productdata_id, cp.partner_product_id, cp.medium_id, cp.image, cp.beschrijving,cp.actief, cp.homepage, product.product_id, product.product_naam, merk.naam as merk, product.actief as product_actief, product.klein_image FROM channel_productdata AS cp INNER JOIN partner_product ON partner_product.partner_product_id=cp.partner_product_id INNER JOIN product ON product.product_id=partner_product.product_id INNER JOIN merk ON merk.merk_id=product.merk_id WHERE cp.partner_channel_id='".$partner_channel_id."' ORDER BY channel_productdata_id DESC ".$top.$lim; -------------------------------------------------------------------------------------------------------------------------------- if anybody could help me i would be eternaly greatfull, this is a pretty important query to me. thanx in advance. greetings Silverado btw ill be posting fulltime again since i have internet @ home again:) Quote Link to comment Share on other sites More sharing options...
fenway Posted February 2, 2007 Share Posted February 2, 2007 You can't have an "AND" in your ORDER BY clause. Quote Link to comment Share on other sites More sharing options...
Silverado_NL Posted February 2, 2007 Author Share Posted February 2, 2007 oh yeah your right, how stupid of me is that:) ??? that's what i get for generating query's. thank you very very much fenway. Quote Link to comment Share on other sites More sharing options...
Silverado_NL Posted February 2, 2007 Author Share Posted February 2, 2007 oh yeah and by the way where the heck is the solve button? i started this post so i should be able to solve it right? cause i can see a post thats solved, so i guess it has been enabled now since my last visit? if anybody could tell me this i would be very gratefull en the board will have more space for more important things:) Quote Link to comment Share on other sites More sharing options...
shoz Posted February 2, 2007 Share Posted February 2, 2007 You should see it at the bottom left hand side after the last post in the thread. 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.