I created function that delete some data from my database. This is part of it:
mysqli_query($con, "DELETE FROM appsdata WHERE ownerID=123");
But I want to check how many rows were deleted. Mysql_query returns always true, no matter if something was deleted :/
You can use mysqli_affected_rows
:
mysqli_affected_rows($mysqli_link);
or
$mysqli->affected_rows
http://php.net/manual/en/mysqli.affected-rows.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With