06.06.2013, 18:09
Yes, you can do it with a query like this:
Obviously, "thepass" is the hashed text the user will input and you compare it with the hashed password stored in your database...
It will return a row if it found the account with that specified username and username (therefore, the login was successful) but if the account wasn't found, it will not return any row (meaning a failed login).
Код:
SELECT * FROM accounts WHERE username='username' AND password='thepass'
It will return a row if it found the account with that specified username and username (therefore, the login was successful) but if the account wasn't found, it will not return any row (meaning a failed login).