mysql_stmt_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

πŸ’– 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 by mysql_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), then mysql_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