Re: registering a session variable from a select statment.
| From: | Lerp | Date: | Tue, 05 Mar 2002 14:42:00 +0000 |
| Subject: | Re: registering a session variable from a select statment. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-87267@lists.php.net to get a copy of this message | ||
Hi there :)
Try something like this:
session register ("user_auth_level");
$user_auth_level = $user_level;
HTH, Joe :)
"Matthew Darcy" <matthew@darcy.demon.co.uk> wrote in message
news:MMEDJGDFIEPMBLFAENDBIEOICKAA.matthew@darcy.demon.co.uk...
> 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
>
> file://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.
>