phpBB

Development Wiki

Dbal.sql transaction

From phpBB Development Wiki

dbal::sql_transaction –– Allows beginning, committing and rolling back database transactions.

Description

  1. bool dbal::sql_transaction ( string $status )

The $db->sql_transaction() method is used for working with transactions. Transactions can lead to performance gains. Their main purpose however, is to maintain the integrity of the database. Multiple queries are grouped into a transaction, which in case of failure, is rolled back completely.

Parameters

status
Status supports:

Parameter Usage
begin Begin the transaction.
commit Make the transaction changes permanent.
rollback Abort transaction, undo changes. You do not call this manually, the DBAL calls it automatically if there is a database error.

Return Values

Returns a boolean value indicating success of the operation.

Examples

TODO

See Also