mysql_stmt_error(3)

πŸ“¦
version 13.0.2 Β· 5 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_error ✨

okay bestie, welcome to the MariaDB Connector/C manual, and today's main character is mysql_stmt_error β€” the function that tells you what went wrong with your statement. she's giving emotional support but make it C. πŸ’–


🌸 NAME 🌸

mysql_stmt_error β€” returns a string description for the last statement error. literally the "what happened bestie" of statement handles. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <mysql.h>

const char * mysql_stmt_error(MYSQL_STMT * stmt);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way this works: she hands you back a string containing the error message for the most recently invoked statement function that can succeed or fail. that's it, that's the job. 🫢

and if nothing went wrong? the string is just empty. no drama, no error, no notes. ✨


πŸ“ PARAMETER πŸ“

  • stmt β€” a statement handle, which was previously allocated by mysql_stmt_init(3). like, she needs her statement to already exist, okay? don't come at her with an uninitialised handle, that's not the vibe. πŸ™ˆ

πŸ‘‘ RETURN VALUE πŸ‘‘

  • A string describing the last error, or an empty string if no error occurred. that's the whole tea. πŸ’–

πŸ’œ NOTES πŸ’œ

  • Client error messages are listed in the errmsg.h header file, server error messages are listed in the mysqld_error.h header file of the server source distribution. iykyk β€” go read the headers if you want the full lore. πŸ“š

🌈 SEE ALSO 🌈

these two are her besties, they run in the same friend group, check them out. πŸ’…


and that's the whole page, periodt. this was Version 3.4 of the MariaDB Connector/C docs β€” thanks for reading, bestie, now go forth and mysql_stmt_error responsibly. πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from