Synopsis
const char *mysql_sqlstate(MYSQL *mysql)
This function returns the SQLSTATE error code for the last
error that occurred for the current connection. The string will
contain five characters and is terminated with a NULL character. A
lack of error is signified by 00000 and unmapped
errors by HY000.