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 5964745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:29:21+00:00 2026-05-22T19:29:21+00:00

I am writing a application in cakePHP, but this is more of a general

  • 0

I am writing a application in cakePHP, but this is more of a general database question. I am a novice in writing database applications and am new to cakePHP.

In my application there are users, and 2 distinct types of groups that they can have associations with. For instance.

Type A – Groups of type A include things like {new users, experienced users, advanced users, administrators, super users}. A user must belong to 1 and only 1 of these groups. These groups are mainly used to control what a user can do with the application.

Type B – Groups of type B include things like {friends, family, co-workers, small-mix, medium-mix, large-mix etc…} A user can belong to many of these groups or none at all. These groups are mainly used to control who we invite to certain functions and events.

At first I thought I would have a table called “Groups” and simply add a fiend called “type” so I can keep them distinct but reuse the same table. All fields would most likely be identical for the 2 different types of groups.

But, I don’t think this will work, since a user can belong to only 1 of type A, but they can belong to any number of groups from type B. How could the relationship be different using only 1 table?

My only thought I have left is to create 2 tables, one for each group type. The fields would be repeats at least for now, but this would allow me to have different relationships to the user table, for example has one, has 0 or more…

Is there a better way to do this? Is my suggested solutions appropriate?

  • 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-05-22T19:29:22+00:00Added an answer on May 22, 2026 at 7:29 pm

    It appears to me that 2 separate tables is a correct solution, because you have 2 different concepts that you have called “group”. Just rename the first “group” to something else such as “Category” and all will make sense.

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

Sidebar

Related Questions

I am writing application in PHP (+ MySQL database), but it gonna be mainly
I am writing application in Linux using C, pthreads and sockets. This will be
Im writing an application that supposed to send coordinates in an SMS, but I've
I'm writing an application which will involve interaction with the database. The application will
I'm writing an application in CakePHP that, for now, is to be used to
I'm writing a small application in CakePHP 2.1, and I want to use Nick
I think this question was already asked, but I couldn't find a solution which
I am working on a CakePHP application at the moment and I am writing
I am writing a web application using CakePHP. Now with cake after a save
I'm writing a simple web application using CakePHP version 1.2 (the latest) and am

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.