Ok I need help. I need to have a friends system in my website but i don’t wont a lot of tables on my server.
In this friends system you can send request and they can accept or reject it?
I can get the friends to send a request but i need away of Getting all of the users friends?
So i can talk to all my friends on my site and if they are not my friend i can not chat to them?
I would make 1 table in mysql “Friends”
Each friend request would INSERT INTO
Friends2 users (the requester and the requestee) and then you can have another colum called accepted which can be 0 or 1 (0=default/pending) (1=accepted).You’ll have to notify the requestee somehow, if they accept you turn
acceptedto 1 and add a friend requestfromthe requestee with accepted ==1, and if they reject you can delete that row.I’m sure theres a much more effecient way to do it, but as far as simplicity I think that’s about as simple as it gets.
to get the friends of user A? just check the database for all
FROMfriends whereaccepted== 1