php - Control different access levels -


I am planning to use two tables (i.e. guest and staff), to control which User is available.

The estimate can sign up for an account, while the employee can not have an employee's account entrusted with only one system administrator.

The question I have received here is:

Assume UserA is an employee and has a login username and password as 'password'.

Now, an estimate comes on the website and as a password applies to a username with 'login001' and 'password'.

Then User B can access

method:

Method one: whenever a user name is applied (does not matter or Employee), both the table estimates and the employee should check to ensure that there is no duplicate.

Method Two: However, for the estimation, user_type can be assigned as GUEST and employee, user-type can be assigned as an employee.

I do not know if the methods of the above version mean or not, if there is no good solution, please give me some direction so that I can do some good practice.

I am not using any framework or OOP to implement my PHP script.

Thanks

I recommend you to combine your two credential tables into 1 Give. Then you get a guest and employee table with reference to the credential table. In this way, you can store additional information about two.

However, you can ask yourself what is the difference between the guest and the employee if the only difference is the difference, you can participate in the credential table with an additional column which defines that Whether the record is a guest record or employee record.

Finally, in your credentials 1 table, you should put a unique barrier on your user name column. This will ensure that only one account has login001 or JOSEMO . Username can be.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -