I have the following code for a sign up form. I want to check the email to see if it's already logged in the database, and if so return an error.
$name = $_POST['name'];
$email = $_POST['email'];
$result = mysqli_query($connection,"SELECT * FROM users WHERE email='$email'");
if($result=="")
{
echo("email was not found");
}
else
{
echo("email was found");
}
I'm having trouble if the results come back as empty. I've tried using several things and can't figure out how to get it work correctly if nothing is found.