I am trying to validate if $email exists in my database. I am 100% sure $email has not been registered before, yet count($results) is returning 1 and $results['email'] is returning an empty string.
I have looked at other examples on how to code a query to the database. I like it this way, so I haven't tried a different way to code it.
In my database I have only 1 email registered and it is different from $email.
Context: Using Netbeans, XAMPP, MySQL Workbench
$records = $conn->prepare('SELECT * FROM users WHERE email = :email');
$records->bindParam(':email',$email);
$records->execute();
$results = $records->fetch(PDO::FETCH_ASSOC);
IF(count($results) == 0){
....