[thelist] PHP/MySQL: Creating Application Users

RUST Randal RRust at COVANSYS.com
Tue May 4 08:39:37 CDT 2004


I am in the process of rebuilding the database for a prototype
application, and I am looking for suggestions for how I am handling
users. I have three types of users: Admin, Employer and Claimant. In the
original design (see table sample below), I use 'userType' to determine
what kind of a user the person logging in is (A==Admin, etc.). The
'accountID' column is a foreign key which links to the appropriate
employer, claimant or administrator table.

I did it this way so that when I log someone in, I only have to check
one table to get all of the necessary information. The think that I
would ideally like to do, I guess, is be able to separate Administrators
from the other user types, because some users where userType=='E' should
be able to have multiple user accounts. If someone with multiple
accounts logs in, the first thing they need to do is select which
account they want to access.

So I guess I need to have an application.administrators table separate
from the users table, but any suggestions are welcome. 

TIA.

APPLICATION.USERS
--------------------------------------------------------------------
userID	userStatus	accountID	userType	username
password
--------------------------------------------------------------------
100		ACT		1000		A		rrust
admin
--------------------------------------------------------------------
101		ACT		4006		E		jdoe
employer
--------------------------------------------------------------------
102		SUS		2008		C		cjones
claimant
--------------------------------------------------------------------

----------
Randal Rust
Covansys Corp.
Columbus, OH 


More information about the thelist mailing list