---
name: "mysql_stmt_field_count"
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_stmt_field_count"
---

# mysql\_stmt\_field\_count(3)

### Name

mysql\_stmt\_field\_count - Returns the number of fields in a result set

### Synopsis

-

  ```
  #include <mysql.h>
  unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt);
  ```

### Description

Returns the number of fields in a result set of a prepared statement.

### Return value

Number of fields or zero if the prepared statement has no result set.

### Parameter

- •

  `stmt` - a statement handle, which was previously allocated by **[mysql\_stmt\_init(3)](/mysql_stmt_init/3.md)**.

### Notes

- •

  The number of fields will be available after calling **[mysql\_stmt\_prepare(3)](/mysql_stmt_prepare/3.md)**

- •

  `mysql_stmt_field_count()` returns zero for statements which don’t produce a result set.

### See Also

- •

  **[mysql\_stmt\_prepare(3)](/mysql_stmt_prepare/3.md)**

- •

  **[mysql\_stmt\_param\_count(3)](/mysql_stmt_param_count/3.md)**
