How to find out how many records I deleted? For example, with this request
DELETE FROM `table` WHERE `id` > 100
How to find out how many records I deleted? For example, with this request
DELETE FROM `table` WHERE `id` > 100
<?php if(mysql_query("DELETE FROM mytable WHERE id = 25")) { echo (mysql_affected_rows()); } ?>
mysql_affected_rows () - returns the number of rows affected by the last INSERT, UPDATE, DELETE.
SELECT ROW_COUNT();
after removal. reference to the documentation
Source: https://ru.stackoverflow.com/questions/170004/
All Articles