> 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-functions/mysql_fetch_field.md).

# mysql\_fetch\_field

## Syntax

```c
MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result);
```

## Parameter

* `result` - a result set identifier returned by [mysql\_store\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_store_result.md) or [mysql\_use\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_use_result.md).

## Description

Returns the definition of one column of a result set as a pointer to a MYSQL\_FIELD structure. Call this function repeatedly to retrieve information about all columns in the result set.

## Return Value

A pointer of a `MYSQL_FIELD` structure, or NULL if there are no more fields.

{% hint style="info" %}
The field order will be reset if you execute a new SELECT query.

In case only information for a specific field is required the field can be selected by using the [mysql\_field\_seek()](/docs/connectors/mariadb-connector-c/api-functions/mysql_field_seek.md) function or obtained by [mysql\_fetch\_field\_direct()](/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field_direct.md) function.
{% endhint %}

## See Also

* [mysql\_field\_seek()](/docs/connectors/mariadb-connector-c/api-functions/mysql_field_seek.md)
* [mysql\_field\_tell()](/docs/connectors/mariadb-connector-c/api-functions/mysql_field_tell.md)
* [mysql\_fetch\_field\_direct()](/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field_direct.md)
* [mysql\_store\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_store_result.md)
* [mysql\_use\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_use_result.md)

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