Jump to content
  • 0

MySQL Advice


qaisjp

Question

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.

Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...