#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    where to store friend relationship


    Originally Posted by requinix
    I'm pretty sure you answered your own question: at a simple level, a table with two user IDs (one is the person, one is the friend).

    if when one user have ping for friend request then database have store one record

    a_id u_id f_id status
    1 1 3 pending
    2 3 2 success



    when f_id based user accept then pending convert to "success" now as per database 1 is 3 friend status is success, that means both are friend.

    my question is if both are friend then where show store in normal database, for SQL query check.
    Last edited by requinix; October 3rd, 2013 at 03:50 AM. Reason: split from http://forums.devshed.com/database-management-46/question-on-facebook-s-database-structure-790884.html
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Originally Posted by amarbhanu
    my question is if both are friend then where show store in normal database, for SQL query check.
    you could leave it right there
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo