# mysql\_fetch\_field

## Syntax

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

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

## 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.

{% 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()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_seek) function or obtained by [mysql\_fetch\_field\_direct()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field_direct) function.
{% endhint %}

## See also

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
