Page 1 of 1

Creating List Within DB

Posted: Mon Feb 05, 2007 11:21 pm
by 4Boredom
Im trying to create a friends list in a database but dont know how to program the input structurally

If someone approves someone as a friend, i donno how to do it

whats easier?

A) FriendsId - Friend A - FriendB [this would be a hige list]

or

B) FriendID -- Friends

I donno how id put multiple entries in friends for b tho?

Re: Creating List Within DB

Posted: Tue Feb 06, 2007 12:34 am
by Christopher
4Boredom wrote:A) FriendsId - Friend A - FriendB [this would be a hige list]
An A-B relationship table would be better. Yes, huge lists are what databases are good at.

Posted: Tue Feb 06, 2007 4:32 am
by Ollie Saunders
I'd say you want a table Friend and another table FriendFriend. Bit of a weird name for a table but it describes the fact that there is a many to many relationship between Friend and errr... Friend :)

Posted: Tue Feb 06, 2007 10:54 pm
by 4Boredom
ok... any idea how id call that up from PHP to display? :/ with both A nd B columns?

Posted: Tue Feb 06, 2007 11:09 pm
by RobertGonzalez
Might I suggest a search of these forums for 'friend list' or 'buddy list' or 'social networking' or something of that nature? This topic has been discussed several times in the past.