Public Member Functions | |
__construct ($connection) | |
Constructor. | |
commit () | |
Commit transaction. | |
rollback ($savepoint=false) | |
Rollback transaction. | |
savepoint ($savepoint) | |
Create rollback savepoint. |
Definition at line 15 of file mysqlTransaction.php.
__construct | ( | $ | connection | ) |
Constructor.
public
mixed | $connection |
Definition at line 39 of file mysqlTransaction.php.
{ $this->objConnection = $connection; //turn off autocommit mysqli_autocommit( $this->objConnection, false ); }
commit | ( | ) |
Commit transaction.
public
Definition at line 53 of file mysqlTransaction.php.
{
return mysqli_commit( $this->objConnection );
}
rollback | ( | $ | savepoint = false |
) |
Rollback transaction.
public
str | $savepoint |
Definition at line 65 of file mysqlTransaction.php.
{ if ( !$savepoint ) return mysqli_rollback( $this->objConnection ); else $objStmt = mysqli_query( $this->objConnection, 'ROLLBACK TO SAVEPOINT ' . $savepoint ) or trigger_error( mysqli_error( $this->objConnection ), E_USER_WARNING ); return $objStmt; }
savepoint | ( | $ | savepoint | ) |
Create rollback savepoint.
public
str | $savepoint |
Definition at line 83 of file mysqlTransaction.php.
{
$objStmt = mysqli_query( $this->objConnection, 'SAVEPOINT ' . $savepoint )
or trigger_error( mysqli_error( $this->objConnection ), E_USER_WARNING );
return $objStmt;
}