I am trying to query 5 separate tables in my mysql database, the structures are as follows;
item
itemid | item | description | brand | date | time | path |
actor
actorid | name | actorthumb | bio |
brand
brandid | brandname | description | image |
movie
movieid | title | genre | year | moviethumb | synopsis|
request
requestid | userid | itemid | brandid | movieid | actorid | content | requestdate |
Currently I can join 2 of the tables and display the information I need, for example an item, who wears it :
$query = "SELECT * FROM actor, request WHERE actor.actorid = request.actorid and itemid = ".$itemid;
and in what film, using
$query = "SELECT distinct * FROM movie, request WHERE movie.movieid = request.movieid and itemid = ".$itemid;
However I need to write 1 query that will display the data from all 5 tables and I can display what I need from these.
I think I need to use the JOIN command however I am not sure how to use this?
Please advise.