const char *mysql_stmt_error(MYSQL_STMT *stmt)


For the statement specified by stmt, mysql_stmt_error() returns a null-terminated string containing the error message for the most recently invoked statement API function that can succeed or fail. An empty string ("") is returned if no error occurred. Either of these two tests can be used to check for an error:

  // an error occurred

if (mysql_stmt_error(stmt)[0])
  // an error occurred

The language of the client error messages may be changed by recompiling the MySQL client library. You can choose error messages in several different languages.

Return Values

A character string that describes the error. An empty string if no error occurred.



Download this Manual
User Comments
  Posted by Philip Stoev on August 11, 2005
If you want installation-language-neutral (that is, always in English) error reporting that is more descriptive than the numerical error codes, you may wish to convert the names of the constants from mysqld_error.h into text strings.
Sign Up Login You must be logged in to post a comment.