php8.5
Home/ Manual/ pdo / pdo/ PDO::inTransaction

PDO::inTransaction

PHP function Edit on GitHub ✎

(PHP 5 >= 5.3.3, Bundled pdo_pgsql, PHP 7, PHP 8)

Checks if inside a transaction

Description

PDO::inTransaction(): bool

Checks if a transaction is currently active within the driver. This method only works for database drivers that support transactions.

Parameters Parameters

Return Values

Returns true if a transaction is currently active, and false if not.

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