Okay, so basically in my MySQL database, I have a table of users, with their unique user id as the primary key.
I am creating a friends system with it, my initial thought was:
"table friend_list"
"int id, int uid, int friend_id"
BUT then I came across the thought that what if
Friend A invites Friend B
AND
Friend B invite Friend A
(You would get
1, 1, 2
2, 2, 1)
I can't seem to come across how I should check if the Friend A has Friend B as a friend (and vice-versa)
Another deal is accepting. Probably something like this?:
"int id, int uid, int friend_id, tinyint(1) real_friend(def0), int inviter, tinyint(1) declined (def0) )
int inviter is the person who invited the other (so the other would get accept?)
Declined would be that if Friend B declines the request from Friend A, it would no longer exist in his request list and if Friend B takes a look at Friend A, he can still accept the request.
My head is already racked up from all this php work, so can you just explain to me how I should do it and any advice?
Thanks in advance,
qaisjp.