我想从多个数据库表中获取数据,并希望对五个以上的表使用选择查询,使用事务查询来帮助提高性能:
try {
// First of all, let's begin a transaction
$this->db->beginTransaction();
// Multiple select queries
$this->db->commit();
return $data;
} catch (Exception $e) {
// An exception has been thrown
// We must rollback the transaction
$this->db->rollback();
}