php8.5
Home/ Manual/ mysqli / mysqli/ mysqli::commit

mysqli::commit

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Commits the current transaction

Description

Oop

mysqli::commit(int $flags = 0, string|null $name = null): bool

Procedural

mysqli_commit(mysqli $mysql, int $flags = 0, string|null $name = null): bool

Commits the current transaction for the database connection.

Parameters

flags

A bitmask of MYSQLI_TRANS_COR_* constants.

name

If provided then COMMIT/*name*/ is executed.

Return Values

Success

Errors/Exceptions Conditionalexception

Changelog

VersionDescription
8.0.0name is now nullable.

Examples

See the mysqli::begin_transaction example.

Notes

Note

This function does not work with non transactional table types (like MyISAM or ISAM).

See Also

Source: reference/mysqli/mysqli/commit.xml · from the official PHP manual (php/doc-en)