mysql_num_rows(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 πŸ¦‹


πŸ‘‘ 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