Welcome Guest, Not a member yet? Register   Sign In
Returning transaction status and record data simultaneously
#1

[eluser]Wayne Smallman[/eluser]
Hi guys!

I'm at a planned stage in a project where I want to implement transactions. However, having read through a thread I'd been looking at, which provided a novel way of managing transactions, I have a question which hasn't been answered by the author of the code, so I'm posting here, in the hope that someone will have an answer.

In the example the author provides for inserting something, the method needs to return the status of the transaction itself:
Code:
function insertSomething()
    {
        $this->trans_start();
        //perform query
        $this->trans_complete();
        
        return $this->db->trans_status() !== FALSE;
    }
However, with the methods I have for inserting records, I need to return their IDs, too. So what's the best way of accomplishing this, other than rolling the two types of data into an array, or is their a better technique?




Theme © iAndrew 2016 - Forum software by © MyBB