require_once("connect.php");
$login1 = $_POST['email'];
$password1 = $_POST['password'];
$select = "SELECT id FROM loginregistration WHERE login ='$login1', password ='$password1'";
$sql = mysqli_query($con,$select);
$row = mysqli_fetch_assoc($sql);
?>`
it seems that my mysqli_query doesn't work ,what should i do?
解决方案
use AND insted of comma (,) in query near password that's why query returning false and throw that error
$select = "SELECT id FROM loginregistration WHERE login ='".$login1."' and password ='".$password1."'";
UPDATE 1
if query fail it return false . so you can use mysqli_error($con); to know the error
require_once("connect.php");
$login1 = $_POST['email'];
$password1 = $_POST['password'];
$select = "SELECT id FROM loginregistration WHERE login ='".$login1."' AND password ='".$password1."'";
$sql = mysqli_query($con,$select);
if($sql === FALSE) {
die(mysqli_error($con)); // better error handling
}
$row = mysqli_fetch_assoc($sql);
?>