469,071 Members | 1,957 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,071 developers. It's quick & easy.

User and Friends Database Structure

2
Hi need help
I have a table "User" (including friends). Each user can have one or more friends which are users too. So my two tables look like this

tblUser
userID (primary)
name

tblFriend
userID (secondary)
friendID (secondary)

How do get the query to print the name of the friend the user is a friend of?

As it is i get from the query

UserID Name FriendID and i dont know how to get the name of the friend who is a user. Thanks
Jan 21 '14 #1
2 908
MWBN
2
Oh and it doesn't matter if A is a friend of B or B is a friend of A. Or that friend request accepted or blocked or anything like that.
Jan 21 '14 #2
Rabbit
12,516 Expert Mod 8TB
Join the friend table to the user table twice.
Jan 21 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Maarten Hendrikx | last post: by
1 post views Thread by Sue | last post: by
1 post views Thread by Xerxes | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.