One database, let's call it "members" and another called "orders".
Now, the "orders" database saves all the usernames as opposed to saving their real names, in case they make changes to them.
I'm trying to use a JOIN query to grab their real name. but since the table is saving two different usernames, I can't figure out how to grab both their real names in a single query.
So far I have this to grab one of their names:
mysql_query("SELECT orders.*, members.Username, members.realname FROM orders JOIN members WHERE orders.Username = members.Username
This code works for 1 of the fields, but the other field, called "Assigned" doesn't want to grab their real name.
Question
Andrew Lyle Global Moderator
Here is my situation.
One database, let's call it "members" and another called "orders".
Now, the "orders" database saves all the usernames as opposed to saving their real names, in case they make changes to them.
I'm trying to use a JOIN query to grab their real name. but since the table is saving two different usernames, I can't figure out how to grab both their real names in a single query.
So far I have this to grab one of their names:
mysql_query("SELECT orders.*, members.Username, members.realname FROM orders JOIN members WHERE orders.Username = members.UsernameThis code works for 1 of the fields, but the other field, called "Assigned" doesn't want to grab their real name.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts