MySQL Forums
Forum List  »  Perl

Re: Where clause not working with aes_decrypt function
Posted by: Randy Clamons
Date: December 15, 2008 11:37AM


From what I see, the password is stored encrypted, otherwise your select columns wouldn't decrypt the password. Your WHERE clause is also decrypting the user-entered password. It doesn't make sense in the context. Probably what you meant was:

$loginUser = "SELECT username, aes_decrypt(password, 'key')
FROM login
WHERE username = '$username' and password = aes_encrypt('$password', 'key')";
$userIn = mysql_query($loginUser) or die("The login error is: " . mysql_error());

Options: ReplyQuote

Written By
Re: Where clause not working with aes_decrypt function
December 15, 2008 11:37AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.