Basics::Rollback

Drop the transactions created since last Basics::Begin

Sintaxe


namespace ProtocolLive\PhpLiveDb;

function Basics::Rollback():void;
See more

- Begin

- Commit

- Transaction

- Types

Example

try{
$Db->Begin();
$consult = $Db->Insert('users');
$consult->FieldAdd('email', 'a@a.com', Types::Str);
$consult->FieldAdd('password', '123', Types::Str);
$consult->Run();
$Db->Commit();
}catch(PDOException){
$Db->Rollback();
}
* The variable $Db are created in PhpLiveDb::__construct