mysql_stmt_field_count(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_field_count β€” bestie, how many fields are we even working with?? πŸ’–

okay so this one lives in the MariaDB Connector/C manual, page mysql_stmt_field_count(3), and it's genuinely one of the chillest little functions you'll ever meet. no drama, no side quests, it just tells you how many fields are chillin' in your result set. πŸŽ€


✨ SYNOPSIS ✨

#include <mysql.h>

unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt);

🌸 DESCRIPTION 🌸

It returns the number of fields in a result set of a prepared statement. that's it. that's the whole vibe. she counts the fields and hands you the number. πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

The number of fields, or zero if the prepared statement has no result set. zero. nada. nothing to see here, bestie. πŸ™ˆ


πŸ¦‹ PARAMETER πŸ¦‹

  • stmt β€” a statement handle, which was previously allocated by mysql_stmt_init(3). so like, you gotta have already made the statement before you can ask her anything, obviously. ✨

πŸ’œ NOTES πŸ’œ

  • The number of fields will be available after calling mysql_stmt_prepare(3). so prepare first, then count. order matters, no cap. πŸ”₯
  • mysql_stmt_field_count() returns zero for statements which don't produce a result set. she's not being rude, there's just literally nothing to count. πŸ’€

🫢 SEE ALSO 🫢


and that's the whole page, bestie!! this one came straight outta Version 3.4 of the MariaDB Connector/C docs, so if you're out here counting fields on some other version… check your docs, okay?? mwah, go slay your prepared statements πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from