PHP mysqli_autocommit() Function

Object oriented style

bool mysqli::autocommit ( bool $mode )

Procedural style

bool mysqli_autocommit ( mysqli $link , bool $mode )

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

Turns on or off auto-commit mode on queries for the database connection.

To determine the current state of autocommit use the SQL command SELECT @@autocommit.

Examples -

Example #1 mysqli::autocommit() example

Object oriented style

Procedural style

ParameterDescription
linkProcedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
modeWhether to turn on auto-commit or not.

Return Values

Returns TRUE on success or FALSE on failure.