in reply to [Solved]: How to get count of rows changed by MySQL UPDATE command using DBI
Update: Oh, well, that will still just give you the number of rows "matched" by any where clause in the update statement, or the total number of rows in the table if there is no where clause...there is no way to easily get only the number of rows "changed", because the database "updates" the data whether the values change or not. You would first have to save the current values, then compare against the values after the update...my $rows_affected = $sth->execute(); # Or my $rows_affected = $dbh->do("update table....");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get count of rows changed by MySQL UPDATE command using DBI (where)
by tye (Sage) on Sep 09, 2015 at 00:07 UTC |