PHP PDO transaction automatic rollBack -


i refining code on 1 of applications converted using php adodb library pdo lately. in adodb once launched transaction automatically rolled if exception should arise queries between begin , commit commands.

does pdo this. if method has query it fails between begin , commit in pdo trsaction automatically rollback or need implicitly called?

you have call rollback (and commit) yourself, pdo won't you. this:

$pdo = new \pdo(/* ... */);  $pdo->begintransaction();  try {     // stuff.. } catch(\exception $e) {     $pdo->rollback();     throw $e; }  $pdo->commit(); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -