Hello,
I got a little problem here. Im building a db where one user can have multiple friends.
My db looks like this:
TABLE user_friends {
friends_id int(10) NOT NULL auto_increment....
user_id int(10)....
friends_id int(10)...
}
Now the plan is to add the user selecting a friend into "user_id" and to add his new friends id number into "friends_id". That way I will know who the users friend is BUT im not sure how to build the db and the php code for adding multiple friends to one user....??
Can I use this method to add multiple friends to one user or is there a better way???
If this method is good, then i would be very happy if you could show me a php code exampel for extracting all the friends. Im not sure how to do that when I got this data in the db:
user_id......friends_id
1................2
1................5
2................3
1................7
Thanks!