jim.davidson Posted April 30, 2007 Share Posted April 30, 2007 I'm running mySQL 4.1.21 PHP and Dreamweaver I have three tables orders - customers – manufacturers Two variables $confirmation_id - $customer_id I need a record set that contains orders.order_date orders.received_date orders.updated_date orders.received_by orders.destroyed_by orders.model_number orders.serial_number orders.capacity orders.confirmation_id customers.contact_name customers.contact_phone manufacturers.manufacture_name When I run my query i get this error: 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 'JOIN manufacturers on orders.manufacturer_id=manufacturers.manufacturer_id WHERE' at line 3 Here's the query: SELECT orders.order_date, orders.received_date, orders.updated_date,orders.received_by,orders.destroyed_by,orders.model_number, orders.serial_number, orders.capacity, orders.confirmation_id, customers.contact_name, customers.contact_phone, manufacturers.manufacture_name FROM orders LEFT JOIN customers on orders.customer_id = $customer_id LEFT JOIN manufacturers on orders.manufacturer_id=manufacturers.manufacturer_id WHERE orders.confirmation_id =$confirmation_id", Any idea what's wrong? Link to comment https://forums.phpfreaks.com/topic/49354-solved-record-set-problem/ Share on other sites More sharing options...
Barand Posted April 30, 2007 Share Posted April 30, 2007 try LEFT JOIN customers on orders.customer_id = customers.customer_id Link to comment https://forums.phpfreaks.com/topic/49354-solved-record-set-problem/#findComment-241833 Share on other sites More sharing options...
jim.davidson Posted April 30, 2007 Author Share Posted April 30, 2007 Thank you that did the trick! I'm still learning...more everyday Link to comment https://forums.phpfreaks.com/topic/49354-solved-record-set-problem/#findComment-241883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.