Jump to content

[SOLVED] Quick Question


Ell20

Recommended Posts

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

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

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.