我想用 PHP 中的代码检查数据库中给定电子邮件地址的任何记录,但是当我在数据库中有那个电子邮件地址时,它说“不存在”!这段代码有什么问题?
$con=mysql_connect("localhost","gvf_lingo","btrbghtre544","vtrbt_lingo");
$result = mysql_query("SELECT user_email FROM rating WHERE user_email='testuser@gmail.com'");
$num_rows = mysql_num_rows($result);
if ($num_rows > 0) {
echo "exist";
}else{
echo "does not exist";
}