mysql_errno — Returns the error code for the most recent function call

unsigned int mysql_errno(MYSQL * mysql);

Returns the last error code for the most recent function call that can succeed or fail.

Parameters

mysql

A mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().

Return value

An error code value for the last call, if it failed. zero means no error occurred.

[Note]

Client error messages are listed in errmsg.h header file, server error messages are listed in mysqld_error.h header file of the server source distribution.

See also

mysql_error(), mysql_sqlstate().