WRT your original idea, I'd advise against having a comma separated list in your friends column. This would make it difficult to search friends. You need a dedicated friends table:
friend_id (autonumber/int)
user_id (int : foreign key on user_id in user table)
friend_id (int : foreign key on user_id in user table)
status (tinyint : e.g. 0 = not accepted yet, 1= accepted, 2 = declined)
This should work with an invitation to be a friend system. Or if you just want to add (like Daniweb's system), no need for status column.
Reputation Points: 1046
Solved Threads: 942
Sarcastic Poster
Offline 6,661 posts
since Oct 2006