Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP mysqli_autocommit() Function

PHP mysqli_autocommit() Function

PHP MySQLi Reference Manual PHP MySQLi Reference Manual

Example

Turn off auto-commit, run some queries, then commit them:


Definition and Usage

The mysqli_autocommit() function turns auto-committing of database modifications on or off.

**Tip:** See the mysqli_commit() function to commit the current transaction for the specified database connection. See the mysqli_rollback() function to roll back the current transaction.


Syntax

mysqli_autocommit(

connection,mode

)

;

Parameters Description
connection Required. Specifies the MySQL connection to use.
mode Required. If set to FALSE, auto-commit is turned off. If set to TRUE, auto-commit is turned on (committing any pending queries).

Technical Details

Return Value: Returns TRUE on success, FALSE on failure.
PHP Version: 5+

PHP MySQLi Reference Manual PHP MySQLi Reference Manual