Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
データベースから一部のデータを削除する関数を作成しました。これはその一部です:
mysqli_query($con, "DELETE FROM appsdata WHERE ownerID=123");
しかし、削除された行数を確認したい。何かが削除されたかどうかに関係なく、Mysql_query は常に true を返します:/
使用できますmysqli_affected_rows:
mysqli_affected_rows
mysqli_affected_rows($mysqli_link);
また
$mysqli->affected_rows
http://php.net/manual/en/mysqli.affected-rows.php