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