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

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

flags

A bitmask of MYSQLI_TRANS_COR_* constants.

name

If provided then ROLLBACK/*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/rollback.xml · from the official PHP manual (php/doc-en)