Files
mariadb-connector-c/man/mysql_affected_rows.3
Georg Richter 7e39b85ab1 CONC-554: man pages for Connector/C
man pages for Connector/C can be found in the man subdirectory
of Connector/C source tree.

The man pages are created from the Connector/C wiki using pandoc
utility and the create_man python script.
2021-06-08 17:37:58 +02:00

47 lines
1.4 KiB
Groff

.\" Automatically generated by Pandoc 2.5
.\"
.TH "mysql_affected_rows" "3" "" "Version 3.2.2" "MariaDB Connector/C"
.hy
.SS Name
.PP
mysql_affected_rows \- returns the number of rows affected by the last
operation
.SS Synopsis
.IP
.nf
\f[C]
#include <mysql.h>
my_ulonglong mysql_affected_rows(MYSQL * mysql);
\f[R]
.fi
.SS Description
.PP
Returns the number of affected rows by the last operation associated
with mysql, if the operation was an \[lq]upsert\[rq] (\f[C]INSERT\f[R],
\f[C]UPDATE\f[R], \f[C]DELETE\f[R] or \f[C]REPLACE\f[R]) statement, or
\-1 if the last operation failed.
.SS Parameters:
.PP
\f[C]mysql\f[R] is a connection identifier, which was previously
allocated by \f[B]mysql_init(3)\f[R] and connected by
\f[B]mysql_real_connect(3)\f[R].
.SS Notes:
.IP \[bu] 2
When using \f[C]UPDATE\f[R], 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.
.IP \[bu] 2
The \f[C]REPLACE\f[R] 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.
.SH Return value
.PP
Returns the number of affected rows or \-1 on error.
.SS See also
.IP \[bu] 2
\f[B]mysql_num_rows(3)\f[R]