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
flagsA bitmask of
MYSQLI_TRANS_COR_*constants.nameIf provided then
COMMIT/*name*/is executed.
Return Values
Success
Errors/Exceptions Conditionalexception
Changelog
| Version | Description |
|---|---|
| 8.0.0 | name 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).