我尝试使用此代码检查我的数据库中是否存在电子邮件地址 3 次
$checkEmail = $_POST['email'];
$query = "SELECT email, count(*) $checkEmail FROM participanti GROUP BY email HAVING $checkEmail = 3";
$result = mysql_query($query) or die(mysql_error());
if ($row = mysql_num_rows($result)){
if ($row[$checkEmail] == 3) {
echo "NY";
}
else{
但在我的网站上它说
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@mail.com FROM participanti GROUP BY email HAVING address@mail.com = 3' at line 1