Hi,
I’m struggling with 3 tables, i want to make a query en have to make two joins (if possible).
[table]
[tr][td] (table 1) [/td][td] [/td][td] (table 2) [/td][td] [/td][td] (table 3) [/td][td] [/td][td] (table 4)[/td][/tr]
[tr][td] Cat (table name) [/td][td] [/td][td] Cat_Prod (table name) [/td][td] [/td][td] Prod (table name) [/td][td] [/td][td] Fab (table name) [/td][/tr]
[tr][td] catagory [/td][td] [/td][td] id [/td][td]=== [/td][td] id [/td][td] [/td][td] name [/td][/tr]
[tr][td] category_id [/td][td] === [/td][td] category_id [/td][td] [/td][td] manufacturer_id [/td][td] === [/td][td] manufacturer_id[/td][/tr]
[/table]
I have to query on category_id and need the fields category, some Prod fields, and ’ name ’ from Fab.
How do I get this?!?!!? :o
[php] $SQL_statement = "SELECT * FROM Cat_Prod JOIN Prod on Cat_Prod.product_id = Prod.id WHERE category_id = ‘$id’ AND Prod.status >0 ORDER BY id ASC ";
[/php]
When I use this I can not diplay Fab.name or Cat.category?
The $id is coming from the url ($category_id=$_GET[‘id’] ; )
Is there someone who can help?
Thanks Rob.