taz
05-29-2009, 01:12 PM
Hi,
I'm trying to create a database layout for a website with 3 user roles: admins, buyers and sellers
Each type of user has a very distinct profile with only a small number common fields.
I'm wondering how I would organize the authentication process?
Right now I would have to SELECT from the 3 tables every time someone logged in to find out what type of user it is.
On the other hand, I thought about creating a "login" table where I would just store: email, password and role.
So then when someone logs in I just do a SELECT from the login table and then based on the role, load the profile info from the corresponding table (admins, buyers, sellers).
Is there any kind of best-practice for this scenario?
Can someone suggest an ideal setup?
Thanks!
I'm trying to create a database layout for a website with 3 user roles: admins, buyers and sellers
Each type of user has a very distinct profile with only a small number common fields.
I'm wondering how I would organize the authentication process?
Right now I would have to SELECT from the 3 tables every time someone logged in to find out what type of user it is.
On the other hand, I thought about creating a "login" table where I would just store: email, password and role.
So then when someone logs in I just do a SELECT from the login table and then based on the role, load the profile info from the corresponding table (admins, buyers, sellers).
Is there any kind of best-practice for this scenario?
Can someone suggest an ideal setup?
Thanks!