I have the following query:
$select_query = "SELECT * FROM users WHERE userName='$user_name', password='$password'";
The problem is that the query always fail, so how can I fix the 'WHERE' condition?
I have the following query:
$select_query = "SELECT * FROM users WHERE userName='$user_name', password='$password'";
The problem is that the query always fail, so how can I fix the 'WHERE' condition?
On
You'll need boolean logic for it:
$select_query = "SELECT * FROM users WHERE userName='$user_name' AND password='$password'";
Of course, this assumes you want the username and password to match. If you want either to match, you should use OR. This is all quite basic database stuff. Please read the documentation or get yourself a good book.
You need to use
AND