Jump to content

Designing a "friend's list" function


dxdolar

Recommended Posts

Trying to figure out the structure of how to design a friend's list type feature. Right now I have ways of going about it (please enlighten me if there are others)

 

1: user a column, labeled 'friends' in a users table and populate it with a text string of user_id's, i.e.

friends

2, 3, 4, 5, 6,

to update it just add on a new number to the string, to delete it :shrug, I don't know really...haha:

 

2: use a friend's junction table with individual relationships, my ID and my friend's ID. i. e.

id1      id2

1    |    2

1    |    3

 

I've been programming with PHP for about 2 weeks now, I've devoured a lot of the basic concepts and now I'm trying to move away from the examples in my book.

 

Any help in figuring out the design would be appreciate. Plus any guidance on how to execute that design, or links to code I can use as a reference, or tuts, would also be a HUGE help. Thanks everyone!

Link to comment
https://forums.phpfreaks.com/topic/115293-designing-a-friends-list-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.