> I want to compare a password to a encrypted password stored in my
mySQL
> database using password('password'), what's the best way to compare
the
> two?
> 
> Encrypted the password sent by the user and compare or pull the
password
> from the database based on username, decrypt it and then compare?

SELECT 1 FROM table WHERE password_column = PASSWORD('$password') AND
username = '$username'

If a row is returned, the username and password match what's in the
database. $password and $username would come from your form or
whatever...

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to