It's just my first post here in stackOverflow.
Could you tell me how it's possible that my code returns 1 in variable $rows even when the email is not listed in my database?
Code
$query = "SELECT COUNT(*) FROM konta
WHERE email='".$fieldsFromForm['email']."'";
if($result = $this->dbo->query($query)){
$rows = $result->num_rows;
if($rows>0){
return USER_NAME_ALREADY_EXISTS;
}
}
count(*). That query always returns one row! The count you are looking for is the data of that row.