Welcome Guest, Not a member yet? Register   Sign In
Database Transactions With Multiple Active Records Calls In Separate PHP Functions
#1

[eluser]asciiCode[/eluser]
I have separate php functions to "create a user" and "create contact information" for a user. Each separate function contains the Active Record db code.

However if I want to use the two functions together, is there any way to do transactions?

The traditional example is:

$this->db->trans_start();
$this->db->query('first sql query');
$this->db->query('second sql query');
$this->db->query('third sql query');
$this->db->trans_complete();

However, I want to do something to this effect:

$this->db->trans_start();
$this->CreateUser();
$this->CreateContactInformation();
$this->db->trans_complete();

Is there anyway to do this?


Messages In This Thread
Database Transactions With Multiple Active Records Calls In Separate PHP Functions - by El Forum - 09-02-2010, 10:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB