Ell20 Posted July 23, 2008 Share Posted July 23, 2008 Hi, I am trying to join 3 tables together. I have only ever joined 2 tables together before and have used INNER JOIN. Below is my attempt, but this is done using an INNER JOIN, not sure whether I have done it wrong, or its not possible to join 3 tables together using INNER JOIN? $query = "SELECT player_id, type, price, username, crew, crewname FROM dom_london INNER JOIN user_info AND crews ON user_info.id = dom_london.player_id AND user_info.crew = crews.id WHERE dom_london.id = '$section'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); Any help is appreciated Elliot Link to comment https://forums.phpfreaks.com/topic/116204-solved-quick-question/ Share on other sites More sharing options...
craygo Posted July 23, 2008 Share Posted July 23, 2008 format is like this $query = "SELECT player_id, type, price, username, crew, crewname FROM dom_london INNER JOIN user_info ON user_info.id = dom_london.player_id INNER JOIN crews ON user_info.crew = crews.id WHERE dom_london.id = '$section'"; Ray Link to comment https://forums.phpfreaks.com/topic/116204-solved-quick-question/#findComment-597545 Share on other sites More sharing options...
Ell20 Posted July 23, 2008 Author Share Posted July 23, 2008 Thanks alot for your help! Link to comment https://forums.phpfreaks.com/topic/116204-solved-quick-question/#findComment-597546 Share on other sites More sharing options...
craygo Posted July 23, 2008 Share Posted July 23, 2008 Don't forget to mark topic as SOLVED Ray Link to comment https://forums.phpfreaks.com/topic/116204-solved-quick-question/#findComment-597562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.