For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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.

Autocommit mode only affects operations on transactional table types. To determine the current state of autocommit mode use the SQL command SELECT @@autocommit. Be aware: the mysql_rollback() function will not work if autocommit mode is switched on.

Examples

SQL

MariaDB Connector/C

spinner

Last updated

Was this helpful?