mysqli::rollback
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Rolls back current transaction
Description
Oop
mysqli::rollback(int $flags = 0, string|null $name = null): bool
Procedural
mysqli_rollback(mysqli $mysql, int $flags = 0, string|null $name = null): bool
Rolls back the current transaction for the database.
Parameters
flagsA bitmask of
MYSQLI_TRANS_COR_*constants.nameIf provided then
ROLLBACK/*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).