I have an issue. I am trying to find out if a user's email already exists in the database here is my query:
$stmt1 = "select EmailAddress from customers where EmailAddress = ' .$emailaddress. '";
$result = $db->query($stmt1);
if($result->num_rows === 0){
$Err = "";
} else {
$Err = 'This user is already registered login instead.';
}
What am I doing wrong? I can't seem to get num_rows to return something I can work with. Shouldn't this query return 0 if no records are found or number of rows if there is a record?