试图阻止用户注册重复的帐户,但代码似乎不起作用,不知道我做错了什么,
var_dump count显示“string(1)”0“
$query1 = "SELECT COUNT(*) FROM users WHERE user_email = :email OR user_name = :username";
$stmt = $DBH->prepare($query1);
$stmt->execute(array(':username' => $username,':email' => $email));
$count = $stmt->fetchColumn();
// var_dump($count);
if ($count > 0) {
$error = "Username or E-Mail in Use. Please try another.";
}