mysql_stmt_fetch(3)
π mysql_stmt_fetch(3) β the MariaDB Connector/C one, bestie
okay so. welcome to mysql_stmt_fetch, a manual page from the MariaDB Connector/C crew (version 3.4, if you were wondering π). pull up a chair, we're fetching rows out here.
β¨ NAME β¨
mysql_stmt_fetch β fetches a result set row from a prepared statement. yes. that's the whole job. she's got one task and she ate π
πΈ SYNOPSIS πΈ
#include <mysql.h>
int mysql_stmt_fetch(MYSQL_STMT * stmt);
π¦ DESCRIPTION π¦
so what she does is: fetch the result from a prepared statement, and drop it straight into the buffer you already bound with mysql_stmt_bind_result(). that's it, that's the vibe β you bound the buffers, she fills them.
lowkey the whole relationship is: you set up the bindings, she hands you the data. iconic duo behavior π«Ά
π PARAMETER π
stmtβ a statement handle. and not just any handle, bestie, it's one that was previously allocated bymysql_stmt_init(3). no hand-wavy "some handle", we need the real one that came out of init. periodt.
β RETURN VALUE β
here's the scoreboard, no cap:
- returns
0for success π - returns
MYSQL_NO_DATAif the end of the result set has been reached (that's the "we're done here, go home" signal π) - returns
MYSQL_DATA_TRUNCATIONif one or more values are truncated (translation: something got cut off, and she's telling you π)
π NOTES π
- note that all columns must be bound by the application before calling
mysql_stmt_fetch(). all of them. every single one. not "most of them". bind first, fetch after. that's the order, i don't make the rules π - data are transferred unbuffered, without calling
mysql_stmt_store_result(3)β which can decrease performance, but it reduces memory cost. so like, it's giving tradeoff energy. pick your fighter. - truncation reporting must be enabled by the function
mysql_optionsv(3), with the optionMYSQL_REPORT_DATA_TRUNCATION. if you want to know about truncation, you gotta turn the reporting on first, fr fr. π
π SEE ALSO π
ok real talk: if you skipped the bind step, none of this works. bind your columns. that's the main character move.
and that's the page, bestie β¨ this was mysql_stmt_fetch(3) from the MariaDB Connector/C manual, version 3.4. go fetch some rows responsibly, ily, bye ππ
π¦ 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