Jump to content

php buddy list


Kingy

Recommended Posts

On my site I have a user system. Something I want to implement into it is a buddy list.

 

eg:

 

Kingy's friends:

bob

john

blah

alice

 

 

What i'm confusing myself over is getting rid of the many to many relationship the tables may have. Could someone enlighten me on how i would map out the databases properly, how many tables i may need to get rid of unwanted many-to-many relationships

 

 

Link to comment
https://forums.phpfreaks.com/topic/125920-php-buddy-list/
Share on other sites

In my opinion, it only need one table to store this realationship. I assumes that, if A is a Buddy of B then B is a Buddy of A.

 

User Name: User_ID

**********************

Kingy 1

bob 2

john 3

blah 4

alice 5

 

 

Relationship Table:

 

User_ID_1 User_ID_2

*************************

1 2

 

1 3

 

1 ` 4

 

1 5

Link to comment
https://forums.phpfreaks.com/topic/125920-php-buddy-list/#findComment-651160
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.