PHP mysqli_commit() Function

Object oriented style

bool mysqli::commit ([ int $flags [, string $name ]] )

Procedural style

bool mysqli_commit ( mysqli $link [, int $flags [, string $name ]] )

Commits the current transaction for the database connection.

Also look at the mysqli_autocommit() function, which turns on or off auto-committing database modifications, and the mysqli_rollback() function, which rolls back the current transaction.

The mysqli_commit() function commits the current transaction for the specified database connection.

Example -

Procedural style

ParameterDescription
linkProcedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
flagsA bitmask of MYSQLI_TRANS_COR_* constants.
nameIf provided then COMMIT/*name*/ is executed.

Return Values

Returns TRUE on success or FALSE on failure.