mysql_affected_rows()
my_ulonglong mysql_affected_rows(MYSQL *mysql)
Returns the number of rows affected (changed) by the last UPDATE,
DELETE or INSERT query. May be called immediately after
mysql_query() for UPDATE, DELETE or INSERT
statements. For SELECT statements, mysql_affected_rows()
works like mysql_num_rows().
mysql_affected_rows() is currently implemented as a macro.
An integer greater than zero indicates the number of rows affected or
retrieved. Zero indicates that no records matched the WHERE clause in
the query or that no query has yet been executed. -1 indicates that the
query returned an error or that, for a SELECT query,
mysql_affected_rows() was called prior to calling
mysql_store_result().
None.
mysql_query(&mysql,"UPDATE products SET cost=cost*1.25 WHERE group=10");
printf("%d products updated",mysql_affected_rows(&mysql));