Hello!
I'm doing a small community project, and got a little problem with mySQL. I got a table for 'users', and a table 'usersfriends' with the user ID, and the mail address of the users friends.
I would like it to work similar to MSN: Your friends doesn't have to be users to be added to your list. You can add their email addresses first, so that they appear on your friendlist. And when they some day sign up, then their emailaddress-nickname will be replaced with the nickname they have used.
Now:
When I make the SELECT to find the mail addresses of the friends they all show up - great!
SELECT friendsmailaddress FROM usersfriends WHERE user='userID'
But when I make the SELECT to find the users friends AND at the same time want to get the nickname from those who are already signed up, I ONLY get the friends who are already signedup.
SELECT friendsmailaddress,nickname FROM usersfriends,user WHERE user='userID' AND user.nickname=usersfriends.friendsmailaddress
What I want to do is to get ALL the friends + the nicknames of those who has signed up. Is that possible, or do I have to make some clumbsy way, by making two SQL selects and then run the result through a perl script??
I'm doing a small community project, and got a little problem with mySQL. I got a table for 'users', and a table 'usersfriends' with the user ID, and the mail address of the users friends.
I would like it to work similar to MSN: Your friends doesn't have to be users to be added to your list. You can add their email addresses first, so that they appear on your friendlist. And when they some day sign up, then their emailaddress-nickname will be replaced with the nickname they have used.
Now:
When I make the SELECT to find the mail addresses of the friends they all show up - great!
SELECT friendsmailaddress FROM usersfriends WHERE user='userID'
But when I make the SELECT to find the users friends AND at the same time want to get the nickname from those who are already signed up, I ONLY get the friends who are already signedup.
SELECT friendsmailaddress,nickname FROM usersfriends,user WHERE user='userID' AND user.nickname=usersfriends.friendsmailaddress
What I want to do is to get ALL the friends + the nicknames of those who has signed up. Is that possible, or do I have to make some clumbsy way, by making two SQL selects and then run the result through a perl script??