Welcome Guest, Not a member yet? Register   Sign In
What's the best way to determine if two tables were updated successfully using Active Record?
#5

[eluser]LeonardoGaiero[/eluser]
I hope nobody minds if I post this a bit late, but could I get some insight over this method? I noticed that the active record lib returns the query if there was no error, so I thought of something like this:

Code:
function insertData($table, $data) {
    if($this->db->insert($table, $data) === FALSE)
        return FALSE;
    else
        return TRUE;
}

My problem is: will the DB function always return the query only on success, or is there a risk that it might return an unhandled query as opposed to boolean false? Is checking this value a foolproof way to determine a query's success? (edited for code coherence.)


Messages In This Thread
What's the best way to determine if two tables were updated successfully using Active Record? - by El Forum - 08-27-2010, 01:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB