mysql_affected_rows
mysql_affected_rows returns the number of rows affected by the last INSERT, UPDATE, DELETE, or REPLACE statement executed on a MariaDB Connector/C connection.
Syntax
my_ulonglong mysql_affected_rows(MYSQL * mysql);Parameter
mysqlis a connection identifier, which was previously allocated by mysql_init() or mysql_real_connect().
Description
Returns the number of affected rows by the last operation associated with MySQL, if the operation was an "upsert" (INSERT, UPDATE, DELETE or REPLACE) statement, or UINT64_MAX (0xffffffffffffffff) if the last query failed.
Return Value
Returns the number of affected rows or -1 on error.
See Also
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

