I'm implementing AES encryption for passwords stored in my application's user table, however, I can't seem to authenticate whether the user exists or not when I run the following query. I can't see what's wrong with it. Any help would be appreciated.
SELECT * FROM user_table WHERE username='users-name' AND password=AES_DECRYPT('users-password','encryption-key');