A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_affected_rows below:

mysql_affected_rows | MariaDB Documentation

mysql_affected_rows | MariaDB Documentation
  1. Connector/C
  2. MariaDB Connector/C API Functions
mysql_affected_rows
my_ulonglong mysql_affected_rows(MYSQL * mysql);

mysql is a connection identifier, which was previously allocated by mysql_init() or mysql_real_connect().

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.

When using UPDATE, MariaDB will not update columns where the new value is the same as the old value. This creates the possibility that mysql_affected_rows may not actually equal the number of rows matched, only the number of rows that were literally affected by the query.

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4