I am using php and sql to check user information from the database. I need to check if the username and password is correct and the account is active. I have this sql query, but it does not work. What is the method to do it?
SELECT * FROM foo WHERE (name='foo' AND password='foo') AND active=1
You could debug your sql like this in php:
This “or die (mysql_error())” will give you the exact error of that query, maybe the DB isn’t selected if that happened use mysql?query($sql, $db)…
Hope it helps