Why does this not work
$sth = $pdo->prepare("SELECT * FROM tempusers WHERE tempusers.username = :username AND tempuser.email = :email AND password = :password");
$sth->bindParam(':username', $register_data['username'], PDO::PARAM_STR);
$sth->bindParam(':email', $register_data['email'], PDO::PARAM_STR);
$sth->bindParam(':password', $register_data['password'], PDO::PARAM_STR);
$sth->execute();
if($sth->fetchColumn() > 0) {
echo 'yes';
}else{
echo 'no';
}
And then when I run this code it works
$sth = $pdo->prepare("SELECT * FROM tempusers WHERE tempusers.username = :username");
$sth->bindParam(':username', $register_data['username'], PDO::PARAM_STR);
$sth->execute();
if($sth->fetchColumn() > 0) {
echo 'yes';
}else{
echo 'no';
}
When I try to use more then on bindParam value the code crashes. Why can't have more the one value to check against?