Create new users with "CREATE USERS" or in a table
Posted: Tue Sep 04, 2007 8:23 pm
Hi,
I'm pretty new to PHP, having only written code for one web site. I'm planning my next project and in this project there will be a set of users who will be registered by an "admin" user. The admin may add or delete new users through time. Each user will have account information and, of course, a password and username.
The problem is, I'm not clear on what is the best way to establish users of a website with PHP. Is one of the following approaches cleaner or is there some other suggestion you can offer me?
1) Using PHP to send the SQL statement "CREATE USER <user_name> PASSWORD <password>" to create my users for my MySQL db
. . . or . . .
2) Creating in my MySQL db a table (e.g. Table "Users") for storing new users, their passwords, etc.
I'm not clear yet on how to best work with multiple users.
Thanks in Advance,
J.T.
I'm pretty new to PHP, having only written code for one web site. I'm planning my next project and in this project there will be a set of users who will be registered by an "admin" user. The admin may add or delete new users through time. Each user will have account information and, of course, a password and username.
The problem is, I'm not clear on what is the best way to establish users of a website with PHP. Is one of the following approaches cleaner or is there some other suggestion you can offer me?
1) Using PHP to send the SQL statement "CREATE USER <user_name> PASSWORD <password>" to create my users for my MySQL db
. . . or . . .
2) Creating in my MySQL db a table (e.g. Table "Users") for storing new users, their passwords, etc.
I'm not clear yet on how to best work with multiple users.
Thanks in Advance,
J.T.