registering a session variable from a select statment.
| From: | Matthew Darcy | Date: | Tue, 05 Mar 2002 11:54:20 +0000 |
| Subject: | registering a session variable from a select statment. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-87256@lists.php.net to get a copy of this message | ||
Hi,
I have a user auth script. Very simple and works.
when I check the username and password I check it against a select all the
values from the user table where the username and password match. (inputted
from a 2 text boxes)
like so
//sets and runs SQL statement that brings back all info on user which
matches us
ername and password.
$sql_authorisation = "SELECT * FROM account_details WHERE
account_name='$login_username' AND
account_password=PASSWORD'$login_password')";
$sql_authorisation_result = mysql_query($sql_authorisation);
I then register 2 session variables $login_username and $login_password
I would like to register a session variable from the select * I did earlier
from the field user_level in the select statment
so session register $user_auth_level='user_level'
is this the correct way to do this ???
Thanks,
Matt.