Jump to content

Inner Join HELP


ballouta

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/223838-inner-join-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/223838-inner-join-help/#findComment-1157099
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.