Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2004
    Location
    Los Angeles, CA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Representing networked people

    Hello!

    I'm trying to design a system for my work where different admins can add people connected to them. At the bare bones, this is just like a social networking site like Friendster.

    From a database perspective, how do you implement a representation of people being linked to a variable number of other people. I was originally thinking to use some kind of variable array attribute in the person table. The only option is SET but that only allows for 64 items. Are there any efficient and flexible ways to implement this "social networking" structure?

    Best, Jay

  • #2
    Regular Coder devinemke's Avatar
    Join Date
    Dec 2004
    Location
    NYC
    Posts
    443
    Thanks
    0
    Thanked 12 Times in 11 Posts
    a classic many-to-many data realtionship: two tables
    a table that stores the users
    a table that links users together

    the link table would look something like:
    link_id (INT) PK
    user1 (INT)
    user2 (INT)

    the user1 and user2 fields relate to the PK from the users table.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •