Jump to content

Friends List


sstangle73

Recommended Posts

Hey everyone i am tring to make a friends list like myspaces where you can add friends i just have a few questions

 

how would i store it in the db im thinking that i need to store 3 things the 2 people's ID and a 1 or 0 - - 0 when one person hasnt accepted the friend request and 1 when they have

Link to comment
https://forums.phpfreaks.com/topic/70528-friends-list/
Share on other sites

Hey there,

 

your right on the money.

so you have your tables:

 

Users

id

name

status (0,1)

 

UserFriends

user_id

friend_id

status (0,1)

 

 

just like you said would be the way to go. it will allow you to add more features down the road to.

 

good luck

Link to comment
https://forums.phpfreaks.com/topic/70528-friends-list/#findComment-354312
Share on other sites

so when they get a seccond friend its just entered into the db twice? so now we would have

 

MY ID 1

FRIEND 2

STAT 1

 

MY ID 1

FRIEND 3

STAT 1

 

MY ID 2

FRIEND 1

STAT 1

 

MY ID 3

FRIEND 1

STAT 1

 

would you store it like that also both ways for eatch set of friends?

Link to comment
https://forums.phpfreaks.com/topic/70528-friends-list/#findComment-354316
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.