mysql_warning_count( )

This C API function returns the number of MySQL warning messages encountered from the previous query.

Syntax

unsigned int mysql_warning_count(MYSQL *mysql)

Explanation

This C API function returns the number of warning messages from MySQL that were encountered from the previous query. This can be useful, for instance, when performing multiple INSERT statements with the IGNORE flag.

Examples

...
MYSQL *mysql;
mysql = mysql_init(NULL);
mysql_real_connect(mysql,"localhost","root","password",
                   "workrequests",0,NULL,0);
...
unsigned int warnings = mysql_warning_count(mysql);
printf("Number of Warnings: %d \n", warnings);
...