我有这个代码:
if(mail($to, $subject, $message, $headers)){
$insert_member_sql = "INSERT INTO members (id, username) VALUES('$id', '$username')";
$insert_member_res = mysqli_query($con, $insert_member_sql);
if(mysqli_affected_rows($con, $insert_member_res)>0){
echo "1";
}else{
echo "0";
}
};
发送电子邮件并将信息插入数据库时一切正常,但 mysqli_affected_rows 不起作用 - 如何在运行查询后编辑此代码以回显 1?