mysql_autocommit
mysql_autocommit enables or disables autocommit mode for the current database connection, returning zero on success or nonzero on failure.
Syntax
my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode);Parameters
mysql- a mysql handle, identifier, which was previously allocated by mysql_init() or mysql_real_connect().auto_mode- whether to turn autocommit on or not.
Description
Toggles autocommit mode on or off for the current database connection. Autocommit mode will be set if mode=1 or unset if mode=0.
Return Value
Returns zero on success, or nonzero if an error occurred.
Examples
SQL
MariaDB Connector/C
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

