mysql_stmt_num_rows(3)
π mysql_stmt_num_rows π
okay bestie so this is a page from the MariaDB Connector/C manual, and today's main character is mysql_stmt_num_rows β she counts rows in a prepared statement result set. that's it, that's the job. and she EATS. π
β¨ NAME β¨
mysql_stmt_num_rows β returns the number of rows in a prepared statement result set. no cap, that's literally her whole thing. π
πΈ SYNOPSIS πΈ
#include <mysql.h>
unsigned long long mysql_stmt_num_rows(MYSQL_STMT * stmt);
look at that signature. clean. iconic. the way she returns an unsigned long long? feral. π
π¦ DESCRIPTION π¦
so what does she actually do? she returns the number of rows in the result set. periodt.
but here's the tea, and this is the part you need to remember fr fr: how you use mysql_stmt_num_rows() depends on whether or not you used mysql_stmt_store_result(3) to buffer the entire result set in the statement handle. that's the whole vibe check. whether you buffered everything or not decides how this goes down. iykyk. π
π PARAMETER π
stmtβ a statement handle, which was previously allocated bymysql_stmt_init(3). like, she's not gonna invent one for you, bestie, you gotta bring your own. π«Ά
β RETURN VALUE β
the number of rows in the result set. that's it. that's the number. β¨
π NOTES π
- if you use
mysql_stmt_store_result(3), thenmysql_stmt_num_rows()may be called immediately. like, no waiting, no drama, she's ready the second you ask. obsessed. π
lowkey important: those two functions are besties. one buffers, the other counts. don't separate them and expect the same energy. π
π§ SEE ALSO π§
version 3.4, babes β straight out of the MariaDB Connector/C manual, and that's the whole page, mwah πβ¨ no notes, she ate, and honestly? we're all a little obsessed. ππ π
π¦ 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