mysql_stmt_bind_result(3)
π mysql_stmt_bind_result β MariaDB Connector/C π
okay bestie, pull up a chair, because this one is literally the glue that makes your result set usable π«Ά
β¨ Name β¨
mysql_stmt_bind_result β she binds result columns to variables. that's the whole job. that's the vibe. π
πΈ Synopsis πΈ
#include <mysql.h>
my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt,
MYSQL_BIND * bind);
π¦ Description π¦
okay so here's the tea: this function binds the columns in the result set to variables. you're basically telling the connector "hey, when you fetch stuff, put it here" and it says "bet" π
Returns zero on success, non-zero on failure. no cap.
π Parameters π
stmtβ a statement handle, which was previously allocated bymysql_stmt_init(3). like, she needs to already exist, you can't just manifest her out of thin air. β¨bindβ an array of[MYSQL_BIND]]structures. and listen, the size of this array must be equal to the number of columns in result set. not more, not less, it's giving exact match energy π
π Notes π
- to figure out the number of columns in the result set, use
mysql_stmt_field_count(3). she will tell you. π₯ - 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)is called. so like, you can change your mind mid-fetch and that's iconic of you, the new binding just won't kick in until the nextmysql_stmt_fetch(3)call. periodt. π
π See Also π
fr fr, go read those three, they're the besties this function runs with π§
and that's the whole page, bestie, go bind some results and slay π
Version 3.4 of the MariaDB Connector/C manual, page mysql_stmt_bind_result(3) β mwah, love that for us ππβ¨
π¦ where this page comes from
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms