hey there,
I'm currently getting an undefined object fetchall error and PDO selection script. because from what I can see the PDO variable is being defined. But maybe that's just me. There's a good chance that I'm missing something.
In a config file. I have defined all variables needed and started the PDO connection as the variable $pdo.
and here's the section of code that is giving me the grief
however I am just getting the error. I made if the e-mail already exists in the database. (Not shown above)PHP Code:
$queryselectemail = "SELECT COUNT(*) FROM users WHERE email = :email";
$values = array('email' => $email);
try {
$tryemail = $pdo->prepare($queryselectemail);
$tryemail->execute($values);
} catch (PDOException $e) {
$title = "There was an error :(";
$output = "We are sorry but there has been an error! The error is a PDO/Mysql error and it is {$e->getMessage()}";
}
}
if($tryemail->fetchAll() < 1){
/* code to insert user data */
}
thanks in advance.



Reply With Quote




Bookmarks