Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
mysql_stmt_affected_rows(3)   MariaDB Connector/C  mysql_stmt_affected_rows(3)

   Name
       mysql_stmt_affected_rows	 -  Returns  the  number of affected rows from
       previous	executed prepared statement

   Synopsis
	      #include <mysql.h>

	      my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt);

   Description
       Returns the number of affected rows by the last prepared	statement  as-
       sociated	 with mysql, if	the operation was an "upsert" (INSERT, UPDATE,
       DELETE or REPLACE) statement, or	-1  if	the  last  prepared  statement
       failed.

   Parameter
        stmt  -  a  statement	handle,	 which	was  previously	 allocated  by
	 [mysql_stmt_init()](mysql_stmt_init().]]

   Notes
        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_stmt_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  num-
	 ber of	deleted	records	in addition to the number of inserted records.

   See Also
        mysql_stmt_insert_id(3)

Version	3.4					   mysql_stmt_affected_rows(3)

Want to link to this manual page? Use this URL:
<
https://man.freebsd.org/cgi/man.cgi?query=mysql_stmt_affected_rows&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help