mysql_stmt_store_result(3)
β¨ NAME β¨
mysql_stmt_store_result β bestie, this one transfers a result set from a prepared statement π
Okay so this is a page from the MariaDB Connector/C manual, and we're gonna get you fluent in it, no cap.
πΈ SYNOPSIS πΈ
#include <mysql.h>
int mysql_stmt_store_result(MYSQL_STMT * stmt);
π¦ DESCRIPTION π¦
The way this works is lowkey specific, so listen up π«Ά
You must call mysql_stmt_store_result() for every query that successfully produces a result set β but only if you want to buffer the complete result set by the client, so that the subsequent mysql_stmt_fetch(3) call returns buffered data.
Like, that "only if" is doing so much heavy lifting here. No result set? No need. Don't wanna buffer client-side? Also no need. But if you do want your mysql_stmt_fetch(3) handing you buffered data, then yes bestie, you're calling this. Periodt. π
π PARAMETER π
stmtβ a statement handle, which was previously allocated bymysql_stmt_init(3). She's gotta come from somewhere, and that somewhere ismysql_stmt_init(3). β¨
π RETURN VALUE π
Returns zero on success, nonzero if an error occurred. That's it, that's the whole vibe check.
π NOTES π
- You can detect whether the statement produced a result set by checking the return value of the
mysql_stmt_field_count(3)function. Sneaky little detective move, we love her. π
π SEE ALSO π
Not me ending this page with the most iconic sign-off ever: this is Version 3.4 of the MariaDB Connector/C docs, and honestly? She ate. Go buffer that result set, bestie ππ§π
π¦ 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