Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8333857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:09:44+00:00 2026-06-09T03:09:44+00:00

I am trying to get into some more advanced web development techniques and have

  • 0

I am trying to get into some more advanced web development techniques and have a few projects in mind that require object relationships. I am developing in PHP and am planning on making the site completely object orientated.

Websites like Facebook have relationships between users, friends, groups, events, likes, posts, comments, ect. A user can belong to a group or many groups and a group can have many users. This same kind of relationship is true for events, likes, posts, comments, ect. So my question is how are these relationships handled and saved?

Obviously there is a very complex database that holds the actual content but when defining relationships such as “Which user belongs to which groups?”, how is this handled? Would all groups have a unique identification such as a hash or id number? And then a user has a “mygroups” array or such that continues to add/delete group ids which render the user a part of a group or not.

I may be way off track but any light shed on my question would be great. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:09:46+00:00Added an answer on June 9, 2026 at 3:09 am

    Let’s take an example. Users and Group.

    It is a MANY to MANY relation ship. That means one user can be in 0 ore more group and One group can have one ore more Users

    So There will be 3 Tables

    USER Table

    USER_ID (INT) Primary Key
    USER_NAME V(VARCHAR)
    

    GROUP Table

    GROUP_ID (INT) Primary Key
    GROUP_NAME (INT) 
    

    USER_GROUP

    USER_GROUP_ID (INT) Primary Key
    GROUP_ID (INT) Foriegn Key (to GROUP Table, GROUP_ID Column)
    USER_ID (INT) Foriegn Key (to USERTable, USER_ID Column)
    

    Some sample data will be like

    USER

     USER_ID              USER_NAME
     --------------------------------
     1                    Scott
     2                    Jon
     3                    Mike
    

    GROUP

     GROUP_ID              GROUP_NAME
     --------------------------------
     161                    Bloggers
     162                    Geeks
    

    USER_GROUP

     USER_GROUP_ID   USER_ID              GROUP_ID
     ----------------------------------------------
       1                1                    161
       2                2                    161
       3                2                    162
       4                3                    161
    

    This means

    1) Scott, Jon & Mike are present in Bloggers group.

    2) Scott is present int eh Geeks group.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get into android development, after some reading i have settled
I'm currently trying to get into Java Web Development in general in Spring more
I'm trying to get into Java web development but seem to be running into
I'm just trying to get more into stl semantics, and converting old loops over
Lately, I have been doing some research into cryptography. To get a better understanding
I'm trying to get into the habit of coding to an interface rather than
I'm just trying to get into the benefits of using CSS vs. tables, but
I am just trying to get into python, but I've found it very difficult
I'm trying to get into mobile UI Automation. I've run into an issue installing
I've got a windows service compiled as AnyCPU. I'm trying to get it into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.