I have developed a website in PHP 5.0. This site requires users to register using unique password. I store the password in encrypted form into mySQL 5.0 DB by using following into update statement -
UPDATE user SET password1=AES_ENCRYPT('".$_POST["password"]."','password')
the query to retrieve the user is -
SELECT * FROM user WHERE userid like BINARY '".$_POST["userid"]."' AND password1 like BINARY AES_ENCRYPT('".$_POST["PASSWORD"]."','password')";
Above functionality works fine for all the cases except for the user whose password is sagar2001 Basically, if a user login attempt with password sagar2001 fails retrieving any record in above select query.
Isn't that weird? I can't figure out what's going on. Any help is appreciated.
Thanks in advance.
p.s.: SAGAR2001 password works fine. Having it saved in non-binary does not help either - problem still stays.