Search the MySQL manual:

9.1.3.12 mysql_errno()

unsigned int mysql_errno(MYSQL *mysql)

Description

For the connection specified by mysql, mysql_errno() returns the error code for the most recently invoked 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 MySQL `errmsg.h' header file. Server error message numbers are listed in `mysqld_error.h'. In the MySQL source distribution you can find a complete list of error messages and error numbers in the file `Docs/mysqld_error.txt'. The server error codes also are listed at section 10.1 Error Returns.

Return Values

An error code value. Zero if no error occurred.

Errors

None.

User Comments

Posted by T. Dorsey Harrington on Friday June 20 2003, @11:19am[Delete] [Edit]

Rather than requiring that we all download the source distribution, which not all of us want to do, why not include the error codes/messages as part of the online docs?

Posted by Michel Côté on Monday July 7 2003, @7:19am[Delete] [Edit]

Yeah that would be a great idea !!!

Add your own comment.