mysql_stmt_execute(3)
π mysql_stmt_execute π
okay bestie, welcome to the MariaDB Connector/C manual, page for mysql_stmt_execute. this one's a baddie, let's get into it π
β¨ Name β¨
mysql_stmt_execute β runs a prepared statement. like, actually sends it. the moment of truth. main character energy β¨
πΈ Synopsis πΈ
#include <mysql.h>
int mysql_stmt_execute(MYSQL_STMT * stmt);
π¦ Description π¦
so basically: this function executes a prepared statement that you already prepared earlier with mysql_stmt_prepare(3). think of prepare as "getting ready" and execute as "okay GO πβοΈπ¨".
and here's the cute part β when it executes, any parameter markers that exist get automatically replaced with the appropriate data. no cap, it just does it for you. you don't have to do the swap yourself, it handles the whole vibe.
π Parameter π
stmtβ a statement handle, which was previously allocated bymysql_stmt_init(3). yes, the handle from init. the origin story matters, bestie.
π Return value π
Returns zero on success, non-zero on failure.
so likeβ¦ 0 is the slay outcome. anything else means something went sideways and you should go check. π
π Notes π
- If the statement is
UPDATE,REPLACE,DELETEorINSERT, the total number of affected rows can be determined by using themysql_stmt_affected_rows(3)function. Likewise, if the query yields a result set themysql_stmt_fetch(3)function is used.
so: affected-rows vibes βmysql_stmt_affected_rows(3). result-set vibes βmysql_stmt_fetch(3). know which one you're in, iykyk π₯
π See Also π
and that's the whole page, bestie π«Ά this was the MariaDB Connector/C manual, mysql_stmt_execute(3), Version 3.4. go execute something iconic π
β¨π§
π¦ 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