![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
|
Handling registered users and non registered users in a database.
I am designing a database where there will be website users(registered users) and non website users who will just call in and a support admin will enter in the request. I am not sure how to set up the tables in the database. Should I have one users table that stores contact info and login info and leave login info blank if the user is not registered, or should I have two tables, one that stores all user contact info and one that stores only user names and passwords for registered users and links to the contact info table. This shouldn't be this hard i don't think. I must be looking to deep into it.
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
I ended up creating a users table that stored the user's contact information and email address. I then made a registered_account table that stores user names and passwords. I linked these two tables together based on user_id from the users table.
|
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 321
Rep Power: 4
![]() |
Aye, not a bad solution. I probably would have gone with the more Unixy but not necessarily as good (I haven't thought about it deeply) approach of having only one kind of user - the registered type of user - and having a shared guest account with a blank password for non-registered users to use. This does mean every non-registered user ends up sharing the same user info in the table if you store other things in there; this would probably be dummy data anyway; and means that they all share the same uid, which is not necessarily great for security since you can't tell which of your unregistered users it was that performed any given action unless you ask them and they volunteer that information, but it does mean one table and is a little simpler.
__________________
"I'm not a genius. Why do I have to suffer?" |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|