---
name: "mysql_stmt_bind_param"
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_param"
---

# mysql\_stmt\_bind\_param(3)

### Name

mysql\_stmt\_bind\_param - Binds parameter to a prepared statement

### Synopsis

-

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

### Description

Binds variables for parameter markers in the prepared statement that was passed to **[mysql\_stmt\_prepare(3)](/mysql_stmt_prepare/3.md)**. 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 parameters.

### Notes

- •

  The number of parameters can be obtained by **[mysql\_stmt\_param\_count(3)](/mysql_stmt_param_count/3.md)**.

- •

  If the number of parameters is unknown, for example when using **[mariadb\_stmt\_execute\_direct(3)](/mariadb_stmt_execute_direct/3.md)**, the number of parameters have to be specified with the **[mysql\_stmt\_attr\_set(3)](/mysql_stmt_attr_set/3.md)** function.

### See Also

- •

  **[mariadb\_stmt\_execute\_direct(3)](/mariadb_stmt_execute_direct/3.md)**

- •

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

- •

  **[mysql\_stmt\_bind\_result(3)](/mysql_stmt_bind_result/3.md)**

- •

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

- •

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

- •

  **[mysql\_stmt\_send\_long\_data(3)](/mysql_stmt_send_long_data/3.md)**
