Multiple user login one account

I have a multiuser application made with SC.
multiuser is implemented using user_id = login
How do i allow user to add other users to his account ?
i want the user to be able to create others users to his own account
Thank you in advance for any help

You need to modify the data structure as well as your application. It’s pretty much work, but in principle you need to add a field ‘masteruser’ to the users table and make the combination a unique key. Then you need to take care that when your other user is creating accounts the master user is also added.

Thank you for your reply

If i understand what you mean
My user table will look like this:

For user signup for the first time

id (primary key)
Masteruser (unique auto-increment)
username
password

The adding user form will look like this:

id
Masteruser (same as for the user adding another user to his account)
username
password
User_id (current logged user)

1- How to automatically set value to ‘‘mastuser’’ when adding new ?

2 - How the login code will look ?