Documentation Home
MySQL 5.7 C API Developer Guide
Download this Manual
PDF (US Ltr) - 1.1Mb
PDF (A4) - 1.1Mb


6.4.8 mysql_stmt_errno()

unsigned intmysql_stmt_errno(MYSQL_STMT *stmt)

Description

For the statement specified bystmt,mysql_stmt_errno() returns the error code for the most recently invoked statement API function that can succeed or fail. A return value of zero means that no error occurred. Client error message numbers are listed in the MySQLerrmsg.h header file. Server error message numbers are listed inmysqld_error.h. Errors also are listed atError Messages and Common Problems.

If the failed statement API function wasmysql_stmt_close(), do not call ormysql_stmt_errno() to obtain error information becausemysql_stmt_close() makes the statement handler invalid. Callmysql_errno() instead.

Return Values

An error code value. Zero if no error occurred.

Errors

None.