What do you think about this block of code? I wan't to execute all queries from array.
foreach($sql_array as $sql) {
try {
$this->_db->transactionStart();
$this->_db->setQuery((string)$sql)->execute();
$this->_db->transactionCommit();
} catch (Exception $e) {
$this->_db->transactionRollback();
JErrorPage::render($e);
}
}
Or should I move $this->_db->transactionStart();
before foreach
statement?