mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-07-26 08:41:58 +00:00
40 lines
1.4 KiB
Groff
40 lines
1.4 KiB
Groff
.\" Automatically generated by Pandoc 3.5
|
|
.\"
|
|
.TH "mysql_affected_rows" "3" "" "Version 3.4" "MariaDB Connector/C"
|
|
.SS Name
|
|
mysql_affected_rows \- returns the number of rows affected by the last
|
|
operation
|
|
.SS Synopsis
|
|
.IP
|
|
.EX
|
|
#include \f[B]<mysql.h>\f[R]
|
|
|
|
my_ulonglong mysql_affected_rows(MYSQL * mysql);
|
|
.EE
|
|
.SS Description
|
|
Returns the number of affected rows by the last operation associated
|
|
with mysql, if the operation was an \[lq]upsert\[rq] (\f[CR]INSERT\f[R],
|
|
\f[CR]UPDATE\f[R], \f[CR]DELETE\f[R] or \f[CR]REPLACE\f[R]) statement,
|
|
or \-1 if the last operation failed.
|
|
.SS Parameters:
|
|
\f[CR]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[CR]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[CR]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
|
|
Returns the number of affected rows or \-1 on error.
|
|
.SS See also
|
|
.IP \[bu] 2
|
|
\f[B]mysql_num_rows(3)\f[R]
|