mysql_num_rows(3)
β¨ NAME β¨
mysql_num_rows β bestie, this is the one that tells you how many rows are chilling in your result set π
So like, real talk, this page lives in the MariaDB Connector/C manual (section 3, the library calls girlies π).
πΈ SYNOPSIS πΈ
#include <mysql.h>
my_ulonglong mysql_num_rows(MYSQL_RES * );
π DESCRIPTION π
Okay so, literally what it says on the tin: it returns the number of rows in a result set. That's the whole vibe. Periodt. β¨
π¦ PARAMETERS π¦
MYSQL_RESβ a result set identifier, and it has to come frommysql_store_result(3)ormysql_use_result(3). No random pointers, bestie, we get it from those two only π«Ά
π NOTES π
The way that mysql_num_rows() behaves lowkey depends on whether you're working with buffered or unbuffered result sets, and this is the part you actually need to remember π
For unbuffered result sets, mysql_num_rows() will not return the correct number of rows until all the rows in the result have been retrieved. Like, it genuinely cannot know yet, bestie β the rows haven't shown up. Don't trust the number early, that's the trap π
β SEE ALSO β
And that's the whole page, angel π§ β this was Version 3.4 of the MariaDB Connector/C manual, mwah, go count your rows responsibly π
π¦ 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