You can call the mysql_autocommit() function to enable or disable the autocommit mode.
Syntax
my_bool
mysql_autocommit(MYSQL *mysql,
my_bool mode)
If the value of mode is 1, the autocommit mode is enabled. If the value of mode is 0, the autocommit mode is disabled.
Return values
0 is returned for a setting success, and a non-zero value is returned for errors.
Errors
None.