这个问题已经在这里有了答案 :
7年前关闭。
if (!empty($_POST)){
$email_to=$_POST['email_to'];
$email_to=mysql_real_escape_string($_POST['email_to']);
$sql = "UPDATE `cosmos`.`members` SET `conf` = '2' WHERE `members`.`email` = '$email_to';";
$result=mysql_query($sql) or trigger_error(mysql_error().$sql);
$count=mysql_affected_rows($result); // line 20
if($count==1){
$rows=mysql_fetch_array($result);
$unique=$rows['u_code'];
$name=$rows['username'];
// ---------------- SEND MAIL FORM ----------------
$to=$email_to;
$subject="Your Account Password Request! - Cosmos";
$header="from: Tayal's/Cosmos ";
$messages= "Hey $name ,\r\n";
$messages.="You recently requested a new password";
$messages.="Confirmation Link \r\n";
$sentmail = mail($to,$subject,$messages,$header);
echo $messages;
} else {
echo "Not found your email in our database";
}
}
警告:mysql_affected_rows()期望参数1为资源,在第20行的C:\ wamp \ www \ a \ l \
forget.php中给出布尔值