When authenticating a user with php and MySQL, which of the following is better practice?
Method 1
MySQL Select where username and password match.
If a result comes back, user is authenticated.
Method 1
MySQL Select password where username matches.
Use php to compare passwords for successful login.
The first one usually, because no need to write extra code if you can do it within MySQL query, also, don't forget to make username
column unique index.