Lithium PHP framework - How to run db transaction on mysql? -
i have been working on e-commerce website in php lithium framework, 1 upgraded cakephp, have use transaction operation on db in mysql. don't know how db transaction in php lithium framework.
since lithium uses pdo, can pdo object , call begintransaction() method.
$foo = app\models\foo::create(); $pdo = connections::get('default')->connection; $pdo->begintransaction(); $foo->bar = 'hello'; $foo->save(); $pdo->commit();
https://github.com/unionofrad/lithium/issues/1004#issuecomment-23690165 http://www.php.net/manual/en/pdo.begintransaction.php
Comments
Post a Comment