I'm trying to build a friend system for my website and it is set up something like this:
User's Table:
id
name
Friendship Table:
member1
member2
So what I want is that when I have values like this (member1 is the user's id and member2 is the friend's id:
member1 - member2
1 2
1 3
1 5
I want to be able to get all of the user's (id of 1 in example) friend's ids. But when I use mysql_fetch_assoc in PHP I get only one of the member2 ids. So even though the member1 has the ids 2,3 and 5 in his friend list, I can only get one of his friend's ids. Is there any way to fix this so that I can get all of his friend's ids? Thanks