我有這樣的代碼:mysqli_affected_rows在PHP中插入
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?
閱讀[mysqli_affected_rows(http://php.net/manual/en/mysqli.affected-rows.php)的檢查。 – Rikesh 2013-03-22 11:16:10