---
name: "mysql_fetch_field"
section: "3"
platform: "linux"
package: "mariadb"
version: "13.0.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mysql_fetch_field"
---

# mysql\_fetch\_field(3)

### Name

mysql\_fetch\_field - Returns the definition of one column of a result set

### Synopsis

-

  ```
  #include <mysql.h>
  MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * 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.

### Parameters

- •

  `result` - a result set identifier returned by **[mysql\_store\_result(3)](/mysql_store_result/3.md)** or **[mysql\_use\_result(3)](/mysql_use_result/3.md)**.

### Notes

- •

  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(3)](/mysql_field_seek/3.md)** function or obtained by **[mysql\_fetch\_field\_direct(3)](/mysql_fetch_field_direct/3.md)** function.

### Return value

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

### See also

- •

  **[mysql\_field\_seek(3)](/mysql_field_seek/3.md)**

- •

  **[mysql\_field\_tell(3)](/mysql_field_tell/3.md)**

- •

  **[mysql\_fetch\_field\_direct(3)](/mysql_fetch_field_direct/3.md)**

- •

  **[mysql\_store\_result(3)](/mysql_store_result/3.md)**

- •

  **[mysql\_use\_result(3)](/mysql_use_result/3.md)**
