The mi_result_row_count() function

The mi_result_row_count() function returns the number of rows affected by the current statement.

Syntax

mi_integer mi_result_row_count(conn)
   MI_CONNECTION *conn;
conn
A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_result_row_count() function returns the number of rows that the current statement on the connection that conn references has affected. The current statement is the most recently executed SQL statement sent to the database server on that connection. For example, if an UPDATE statement modifies three rows, a call to mi_result_row_count() returns 3. If a SELECT statement returns 531 rows, mi_result_row_count() returns 531.
Important: Use the mi_result_row_count() function only after the mi_get_result() function returns MI_DML.

Return values

>=0
The number of rows affected.
MI_ERROR
The function was not successful.