I have a difficult join situation which I am not quite sure on the SYNTAX or if it's even possible:
This basically gets info from my "alliances table" but the problem is the leader, sub, officer1, officer2, officer3 columns.
These columns contain the user id who is in the role at the time. I want to get the user name for each by joining this table somehow with my users table (which contains each user's name).
Can it be done, or do I have to store usernames in the alliances table as well as their id's?
Code:
$raw_alliance_info = mysql_query( "SELECT name, code, description, members, focus, bonus, leader, sub, officer1, officer2, officer3 FROM alliances WHERE id='$alliance_id'");
These columns contain the user id who is in the role at the time. I want to get the user name for each by joining this table somehow with my users table (which contains each user's name).
Can it be done, or do I have to store usernames in the alliances table as well as their id's?
Comment