mysql_stmt_affected_rows — Returns the number of affected rows from previous executed prepared statement
my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt);
Returns the number of affected rows by the last prepared statement associated with mysql
, if the operation was an "upsert" (INSERT, UPDATE, DELETE or REPLACE) statement.
Returns the number of affected rows on success, or -1 if the last prepared statement failed.
When using UPDATE, MariaDB will not update columns where the new value is the same as the old value. This creates the possibility that The REPLACE statement first deletes the record with the same primary key and then inserts the new record. This function returns the number of deleted records in addition to the number of inserted records. |