- I have created a 'user' table which stores username and password.
- Inserted user details using this query (for password, used PASSWORD() function) :
INSERT INTO user (username, password) VALUES ('testuser3', PASSWORD('helloworld'));
- Now to validate user, used the following query :
SELECT * FROM user WHERE username = 'testuser3' AND password = PASSWORD('helloworld');
- Idea is if the SELECT query return a row, the user is authenticated otherwise not. But response I am getting is 'Empty set' even though username and password are correct.
So what do I have to update in this SELECT query to get the desired result?
NOTE : this question is very particular to the scenario mentioned in the question. To actual store password use salted hash concept. More can found in comments below by O. Jones and martinstoeckli