Hello,
Now i am working on a social network website and i already built the friends table for this website but i need some suggesion before i moved forward.
I have a user table where user_id is the primary field.
So for frinds i made a friends table with fields like
friend1,friend2,is_active
what i do actually when user1 send a friend request to user2 then at that moment i insert the two rows into the friends table like
1- friend1->user1,friend2->user2,inactive 2- friend1->user2,friend2->user1,inactive
So when somebody accept the frind request at that moment i made the both rows as active.
I made this two entries as i want whenever one user block another then easily made that corresponding row belongs to that user will be inactive.
And if a user remove the user then at that time i delete the both entries.
So please i need some suggesion regarding this plz help me out to solve this asap.
I need to know is there any other way which will be more optimised than this and giving proper result.