luminous Posted June 3, 2010 Share Posted June 3, 2010 I'm having trouble trying to understand where to put a 'join' in this query, this returns: #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 ' ps_orders ON O.id_order = OD.id_order AI.id_address=id_address_invoice AND' at line 34 SELECT O.`id_order`, OD.id_order, O.`date_add`, O.`total_paid`, O.`total_shipping`, O.`delivery_date`, O.`invoice_date`, C.`id_gender`, AD.`firstname`, AD.`lastname`, AD.`company`, C.`email`, AD.`phone_mobile`, AD.`phone`, CONCATC(AD.`address1`, " ", AD.`address2`, " ", AD.`postcode`, " ", AD.`city`), CONCAT(AI.`address1`, " ", AI.`address2`, " ", AI.`postcode`, " ", AI.`city`), OD.`product_name`, OD.`product_quantity`, OD.`product_weight`, OD.`product_price`, CA.`name`, CL.`delay`, M.`name` FROM ps_carrier_lang AS CL, ps_carrier as CA, ps_orders AS O, ps_customer AS C, ps_order_detail AS OD, ps_manufacturer AS M, ps_address AS AD, ps_address AS AI LEFT OUTER JOIN ps_order_detail, ps_orders ON O.id_order = OD.id_order AI.id_address=id_address_invoice AND AD.id_address=id_address_delivery AND CA.id_carrier = O.id_carrier = CL.id_carrier AND C.id_customer=O.id_customer AND O.id_order = 28 Can someone please help? Quote Link to comment https://forums.phpfreaks.com/topic/203734-join-syntax/ Share on other sites More sharing options...
luca200 Posted June 3, 2010 Share Posted June 3, 2010 Looks like you're joining about ten table, but it's hard to understand not knowing what you want to do. Anyway that syntax is obviously incorrect, as the ON clause must be together with the explicit JOIN clause Quote Link to comment https://forums.phpfreaks.com/topic/203734-join-syntax/#findComment-1067072 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.