---
name: "mysql_stmt_bind_result"
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_bind_result"
---

# mysql\_stmt\_bind\_result(3)

### Name

mysql\_stmt\_bind\_result - binds result columns to variables

### Synopsis

-

  ```
  #include <mysql.h>
  my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt,
                                 MYSQL_BIND * bind);
  ```

### Description

Binds columns in the result set to variables. Returns zero on success, non-zero on failure.

### Parameters

- •

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

- •

  `bind` - an array of \[MYSQL\_BIND\]\] structures. The size of this array must be equal to the number of columns in result set.

### Notes

- •

  To determine the number of columns in result set use **[mysql\_stmt\_field\_count(3)](/mysql_stmt_field_count/3.md)**.

- •

  A column can be bound or rebound at any time, even after a result set has been partially retrieved. The new binding takes effect the next time **[mysql\_stmt\_fetch(3)](/mysql_stmt_fetch/3.md)** is called.

### See Also

- •

  **[mysql\_stmt\_field\_count(3)](/mysql_stmt_field_count/3.md)**

- •

  **[mysql\_stmt\_execute(3)](/mysql_stmt_execute/3.md)**

- •

  **[mysql\_stmt\_fetch(3)](/mysql_stmt_fetch/3.md)**
