I’m not sure how to check for matches on my database when users login and return true if both pass and user match with an entry.
The variables corresponding to the username and password are: $user and $hash. And the table where I must look for matches is table Users and columns: User and Password.
How would the query be? Thanks
This is the query you need:
If that returns a result (you can check with
mysql_num_rows()), then the login is valid. If it doesn’t, it’s invalid. Remember to escape$userwithmysql_real_escape_string()or another escaping function before you use it in the database query.