我遇到了变量问题。似乎我必须始终在使用 $variable 之前对其进行初始化。这很烦人。$username_check=mysql_num_rows($sql_username_check); 这里它说注意:未定义的变量:c://中的用户名检查注意:未定义的变量:c://中的电子邮件检查我正在检查数据库中的重复数据。不幸的是,它正在添加相同的数据:(有人可以帮助我吗?
// Database duplicate Fields Check
$sql_username_check = mysql_query("SELECT user_id FROM users WHERE user_username='$username' LIMIT 1");
$sql_email_check = mysql_query("SELECT user_id FROM users WHERE user_email='$email' LIMIT 1");
if($sql_username_check != "")
if(isset($username_check))
$username_check= mysql_num_rows($sql_username_check);
if($sql_email_check != "")
if(isset($email_check))
$email_check = mysql_num_rows($sql_email_check);
if ($username_check > 0){
$errorMsg = "<u>ERROR:</u><br />Your User Name is already in use inside of our system. Please try another.";
}
else if ($email_check > 0){
$errorMsg = "<u>ERROR:</u><br />Your Email address is already in use inside our system. Please try another.";
}