mysql\_warning\_count(3) MariaDB Connector/C mysql\_warning\_count(3)

## [Name](#Name)

mysql\_warning\_count - Returns the number of warnings

## [Synopsis](#Synopsis)

```
#include <mysql.h>
unsigned int mysql_warning_count(MYSQL * mysql);
    
```

## [Description](#Description)

Returns the number of warnings from the last executed query, or zero if there are no warnings.

## [Parameter](#Parameter)

•

mysql - a mysql handle, which was previously allocated by [**mysql\_init(3)**](/man/os/mariadb-11.6/mysql_init.3) and connected by [**mysql\_real\_connect(3)**](/man/os/mariadb-11.6/mysql_real_connect.3).

## [Notes](#Notes)

•

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

•

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

## [Return value](#Return_value)

Returns the number of warnings

## [See also](#See_also)

•

[**mysql\_error(3)**](/man/os/mariadb-11.6/mysql_error.3)

•

[**mysql\_errno(3)**](/man/os/mariadb-11.6/mysql_errno.3)

Version 3.4

---

Document: mysql_warning_count(3) from mariadb-11.6 11.6.2-r0 (Chainguard OS)
