mysql_warning_count — Returns the number of warnings from the last executed query

unsigned int mysql_warning_count(MYSQL * mysql);

Returns the number of warnings from the last executed query

Parameters

mysql

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

Return value

The number of warnings or zero if there are no warnings

[Note]

For retrieving warning messages you should use the SQL command SHOW WARNINGS

If sqlmode TRADITIONAL is enabled an error instead of warning will be returned. For detailed information check the server documentation.

See also

mysql_stmt_affected_rows()