my if
statement is stopping at empty it's not running the sql part, please help
//check if signin is clicked
if (isset($_POST['Signin'])){
//including database
include_once 'inc/dbs.php';
//variables
$email = mysqli_real_escape_string($conn, $_POST['email']);
$pwd = mysqli_real_escape_string($conn, $_POST['pwd']);
//check if fields are empty
//this is where the if statement stoped
if (empty($email) || empty($pwd)){
header('Location: project.php?empty field');
exit();
}
//if user has an account
//this line isn't working
else{
$sql = "SELECT * FROM users WHERE email = $email";
$row = mysqli_query($conn, $sql);
$result = mysqli_num_rows($row);
if ($result < 1)
{
header('Location: project.php?error');
exit();
}
else
{
header('Location: admin.php');
exit();
}
}
}
else{
header('Location: project.php?please fill and submit');
exit();
}