On Tue, 4 Feb 2003, Jianping Zhu wrote:
>
> I have mysql in a redhat machine. I need to use mysql do user
> authentication to a website.
> I have a table like following.
>
> +----------+----------+
> | username | passwd |
> +----------+----------+
> | jianping | jian1830 |
> | chichi | jian1830 |
> +----------+----------+
>
> I want the passwd field not to be plain text but encrypted. how can i do
> that?
>
> Thanks.
use the following sql syntax when creating a user
INSERT into tbl_name (username,password) values
('user',PASSWORD('passwd'));
and when authenticating the user you can do something like
SELECT username from tbl_name where passwd=PASSWORD('$pass'); and in this
case $pass is the variable holding the password entered on the webpage.
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
Regards,
Eric
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php