Sunday, December 12, 2010

Transaction & rollback query in Drupal 7



<?php
$transaction = db_transaction();
try{
//operation on a multiple table 
//blah blah
}catch (Exception $e) {
  $transaction->rollback('testtable', $e->getMessage(), array(), WATCHDOG_ERROR);
}
?>

No comments:

Post a Comment