I am writing a login script. This part is supposed to authenticate the user when they enter their email and password, but I keep getting the same error message, below:
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\own_login\authenticate.php on line 28
Could not execute query
below is the PHP script from line 24 - 28
#create SQL query
$sql = mysql_query("SELECT * FROM users WHERE email = \"$email\" and password = \"$password\"");
#execute query
$rs = mysql_query($sql,$conn) or die("Could not execute query");
Please help. Thanks
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\own_login\authenticate.php on line 28
Could not execute query
below is the PHP script from line 24 - 28
#create SQL query
$sql = mysql_query("SELECT * FROM users WHERE email = \"$email\" and password = \"$password\"");
#execute query
$rs = mysql_query($sql,$conn) or die("Could not execute query");
Please help. Thanks