[eluser]Otemu[/eluser]
Hi,
In the user guide you can use transactions like this:
Code:
$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();
I just wondered if anyone knew if it was possible to use multiple model functions with one transaction action like this:
Code:
function model1(){
$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
}
function model2(){
$this->db->query('ANOTHER QUERY...');
}
}function model3(){
$this->db->query('ANOTHER QUERY...');
}
function model4(){
$this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();
}
This is just so that I could have some logic on my controller such as depending on results from model1 either run model 2 or model 3 function and then complete with model 4