ballouta Posted January 9, 2011 Share Posted January 9, 2011 Hello I am trying to collect Books Information from FOUR tables. First Table: dmc9strproduct Second Table: dmc9strproduct_description (product_id | name) Third Table: dmc9strcover_type (cover_type_id | name) Fourth Table: dmc9strmanufacturer (manufacturer_id | name) The First Table has the following columns: product_id | ISBN | manufacturer_id | price | cover | yop | edition | weight | width | height I want to display all the above information and get the manufacturer NAME from the 4th table Get the cover NAME from the third table, Get the NAME of each book from the 2nd table. Example of a real data in the first Table: product_id | ISBN | manufacturer_id | price | cover | yop | edition | weight | width | height 49 | 9953200319 | 11 | 1.66 | 4 | 2008| 1 | 66 | 17 | 12 I tried to write a query but I got a syntax error message, plus I am NOT sure who to get all values from the other three tables. This was my query: $query = "SELECT name.dmc9strproduct_description, name.dmc9strmanufacturer, name.dmc9strcover_type, model.dmc9strproduct, price.dmc9strproduct, pages.dmc9strproduct, cover.dmc9strproduct, yop.dmc9strproduct, edition.dmc9strproduct, weight.dmc9strproduct, width.dmc9strproduct, height.dmc9strproduct, FROM dmc9strproduct, dmc9strcover_type, dmc9strmanufacturer, dmc9strproduct_description JOIN dmc9strproduct_description.product_id = dmc9strproduct.product_id "; Kindly Help Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/223838-inner-join-help/ Share on other sites More sharing options...
revraz Posted January 9, 2011 Share Posted January 9, 2011 And the syntax error was.. Quote Link to comment https://forums.phpfreaks.com/topic/223838-inner-join-help/#findComment-1156975 Share on other sites More sharing options...
ballouta Posted January 9, 2011 Author Share Posted January 9, 2011 The error was: #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 'FROM dmc9strproduct, dmc9strcover_type, dmc9strmanufacturer, dmc9strproduct_des' at line 7 Quote Link to comment https://forums.phpfreaks.com/topic/223838-inner-join-help/#findComment-1157099 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.