mysql\_fetch\_fields(3) MariaDB Connector/C mysql\_fetch\_fields(3)

## [Name](#Name)

mysql\_fetch\_fields - returns an array of fields

## [Synopsis](#Synopsis)

```
#include <mysql.h>
MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res);
    
```

## [Description](#Description)

This function serves an identical purpose to the [**mysql\_fetch\_field(3)**](/man/enterprise-packages/mariadb-10.6/mysql_fetch_field.3) function with the single difference that instead of returning one field at a time for each field, the fields are returned as an array. Each field contains the definition for a column of the result set.

## [Parameters](#Parameters)

•

res - a result set identifier returned by [**mysql\_store\_result(3)**](/man/enterprise-packages/mariadb-10.6/mysql_store_result.3) or [**mysql\_use\_result(3)**](/man/enterprise-packages/mariadb-10.6/mysql_use_result.3).

## [Notes](#Notes)

The total number of fields can be obtained by [**mysql\_field\_count(3)**](/man/enterprise-packages/mariadb-10.6/mysql_field_count.3).

## [Return value](#Return_value)

an array of type MYSQL\_FIELD.

## [See also](#See_also)

•

[**mysql\_fetch\_field(3)**](/man/enterprise-packages/mariadb-10.6/mysql_fetch_field.3)

•

[**mysql\_fetch\_field\_direct(3)**](/man/enterprise-packages/mariadb-10.6/mysql_fetch_field_direct.3)

•

[**mysql\_field\_count(3)**](/man/enterprise-packages/mariadb-10.6/mysql_field_count.3)

Version 3.3

---

Document: mysql_fetch_fields(3) from mariadb-10.6 10.6.28-r4 (Chainguard OS)
Source: https://github.com/MariaDB/server.git
