mysql\_stmt\_bind\_result(3) MariaDB Connector/C mysql\_stmt\_bind\_result(3)

## [Name](#Name)

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

## [Synopsis](#Synopsis)

```
#include <mysql.h>
my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt,


                               MYSQL_BIND * bind);
    
```

## [Description](#Description)

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

## [Parameters](#Parameters)

•

stmt - a statement handle, which was previously allocated by [**mysql\_stmt\_init(3)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_init.3).

•

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

## [Notes](#Notes)

•

To determine the number of columns in result set use [**mysql\_stmt\_field\_count(3)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_field_count.3).

•

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)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_fetch.3) is called.

## [See Also](#See_Also)

•

[**mysql\_stmt\_field\_count(3)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_field_count.3)

•

[**mysql\_stmt\_execute(3)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_execute.3)

•

[**mysql\_stmt\_fetch(3)**](/man/enterprise-packages/mariadb-12.2/mysql_stmt_fetch.3)

Version 3.4

---

Document: mysql_stmt_bind_result(3) from mariadb-12.2 12.2.2-r9 (Chainguard OS)
Source: https://github.com/MariaDB/server.git
