> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mariadb_stmt_fetch_fields.md).

# mariadb\_stmt\_fetch\_fields

## Syntax

```c
MYSQL_FIELD *mariadb_stmt_fetch_fields(MYSQL_STMT * stmt);
```

## Parameter

* `stmt` - A statement handle, which was previously allocated by [mysql\_stmt\_init()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_init.md).

## Description

Returns an array of fields. Each field contains the definition for a column of the result set.\
If the statement doesn't have a result set a NULL pointer will be returned.

This function was added in Connector/C 3.1.0

{% hint style="info" %}
The number of fields can be obtained by [mysql\_stmt\_field\_count()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_field_count.md)
{% endhint %}

## See Also

* [mysql\_stmt\_field\_count()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_field_count.md)

{% @marketo/form formId="4316" %}
