Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.