wpdb delete query count
The $wpdb->query(...)
function returns an integer value corresponding to the number of rows affected. So, if you delete 10
rows then it'll return 10
, use it like:
$count = $wpdb->query('delete query');
Also you may use:
$count = $wpdb->delete( $table, $where, $where_format = null );
Returns the same affected rows on successful operation and false on failure. Read more on Codex.