OK, this is neat, but I can't seem to get it to wrok correctly.  I can
insert it just fine (i see the encrypted password in the field), but
when I try to select it using the plain text password I can't.

(using perl) for inserting:

$insert_user = "insert into $table (email,password,date) VALUES
(\"$email\",password( '$password '))";

for selecting:

$select_record = "select customer_id,email,password from $table where
bill_email =\"$email\" AND password=password( '$password' )";

am i doing something wrong?

thanks!

rory

On Mon, 2002-04-08 at 23:43, Luke Davison wrote:
> Rory,
> 
> I would recommend using MySQL's buit in password() function:
> 
> INSERT INTO user ( username,password ) VALUES ( 'someuser', password(
> 'plaintextpasshere' ) );
> SELECT ( username, password ) FROM user WHERE username='someuser' AND
> password=password( 'plaintextpass' );
> 
> Regards,
> Luke Davison
> 
> ----- Original Message -----
> From: "rory oconnor" <[EMAIL PROTECTED]>
> To: "perl" <[EMAIL PROTECTED]>
> Sent: Monday, April 08, 2002 9:08 PM
> Subject: Password Encryption for MySQL field
> 
> 
> > I'm writing a small perl script that will help web users manage an
> > "account" (i.e. their record in a mysql table).  I want to store their
> > password in a field, but I don't want to store it in regular text.  I'm
> > not sure if this is a perl or MySQL function, but I think there is some
> > method of "encrypting" the password in the field.
> >
> > Has anyone done that before?  Any help appreciated!
> >
> > Thanks,
> >
> > Rory
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to