mysql\_stmt\_field\_count(3) MariaDB Connector/C mysql\_stmt\_field\_count(3)

## [Name](#Name)

mysql\_stmt\_field\_count - Returns the number of fields in a result set

## [Synopsis](#Synopsis)

```
#include <mysql.h>
unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt);
    
```

## [Description](#Description)

Returns the number of fields in a result set of a prepared statement.

## [Return value](#Return_value)

Number of fields or zero if the prepared statement has no result set.

## [Parameter](#Parameter)

•

stmt - a statement handle, which was previously allocated by [**mysql\_stmt\_init(3)**](/man/os/mariadb-11.6/mysql_stmt_init.3).

## [Notes](#Notes)

•

The number of fields will be available after calling [**mysql\_stmt\_prepare(3)**](/man/os/mariadb-11.6/mysql_stmt_prepare.3)

•

mysql\_stmt\_field\_count() returns zero for statements which don’t produce a result set.

## [See Also](#See_Also)

•

[**mysql\_stmt\_prepare(3)**](/man/os/mariadb-11.6/mysql_stmt_prepare.3)

•

[**mysql\_stmt\_param\_count(3)**](/man/os/mariadb-11.6/mysql_stmt_param_count.3)

Version 3.4

---

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