Mysql Query - That Is Returning Blatanty Incorrect Result
Posted
by
user866190
on Server Fault
See other posts from Server Fault
or by user866190
Published on 2012-04-13T16:29:28Z
Indexed on
2012/04/13
17:33 UTC
Read the original article
Hit count: 203
I am building a VPS node that is running Ubuntu 10.10LTS, Apache2, Mysql 5.1 and php5.
I could not log in to my website admin through the browser, even though I am using the correct login details. So I logged in from the command line to check the results.
When I run this query I get expected results:
mysql> select * from users;
+----+----------+-----------------------+----------+
| id | username | email | password |
+----+----------+-----------------------+----------+
| 1 | myUserName | [email protected] | myPassword |
+----+----------+-----------------------+----------+
And the same goes for this query:
mysql> select * from users where id = 1;
+----+----------+-----------------------+----------+
| id | username | email | password |
+----+----------+-----------------------+----------+
| 1 | myUserName | [email protected] | myPassword |
+----+----------+-----------------------+----------+
1 row in set (0.00 sec)
But when I run this query I get this 'unexpected response':
mysql> select * from users where username = 'myUserName' and password = 'myPassword';
Empty set (0.00 sec)
I am not sure why this is happening. Any help would be greatly appreciated. BTW.. I will be encrypting the user details but for now I just want to get it set up.
Please help,
Thanks
© Server Fault or respective owner