Jump to content

'users' table with 'child' accounts


theredwino

Recommended Posts

i'm working on a CMS project in PHP/MySQL that includes a 'users' table--a list of clients and their contact info.  Recently, the client i'm building this for asked me to include a feature wherein an 'executor' client profile could have 'child' accounts.  For instance, if a client wanted to place his wife and kids 'under his account', an admin could simply open his profile and drag and drop client names from the 'All Clients' list into a box on his profile.  This way, when his profile is opened, these accounts and their contact data, etc. would be listed below his.

 

Now, i know what i'm doing when it comes to building most of this.  In fact, most of it's already built.  My question is:  What is the best method for storing the 'child' account indexes in a MySQL field?  The client profile information is already there, stored in the 'users' table.  What [i think] i need to do is add a 'children' column to the 'users' table and populate it with the child client id's.  The problem is, i'm not sure what the best/most efficient field type is to use.  i was planning on using SET, but that doesn't work because any given 'executor' client could have anywhere from 1 to an indefinite number of 'child' accounts associated with it.  This seems (theoretically at least) to be a pretty easy problem to solve...i'm just not sure how.

 

If anybody has any advice for me, thank you very much in advance!

Link to comment
https://forums.phpfreaks.com/topic/200835-users-table-with-child-accounts/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.