Jump to content

MySQL JOIN tables need help


valtido

Recommended Posts

Hi all im in a sorta dilema more or less.

Basically i have tried a few different things on how to make a relationship between users and their friends ...

 

Basically i got tables like sooo..

 

Users  Table

UserID      -    UsersName          -        FriendsID

1                      John                            ?

2                      Ben                              ?

3                      Tom                            ?

 

Friends table

Friends ID                UserID              Status

1                              ?                  Accepted

2                              ?                  Rejected

3                              ?                  Pending

 

 

so whot im trying to do is to find a way to allow this people to be friends whith one another and when they other user accepts the friendship request they are friends....

 

for example john sends a request to be friends with ben and ben accepts they are now friends...

 

if you dont understand please ask  thank you....

 

Link to comment
https://forums.phpfreaks.com/topic/56152-mysql-join-tables-need-help/
Share on other sites

:) you may put two insert there - for example if id=1 add id=20 then there will be two rows for them one for id=1 saying that his friend is id=20 and vice versa... then if id=1 deleted id=20 as his friend then delete row id=1 and change the status of id=20..something like that may help you...

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.