Welcome Guest, Not a member yet? Register   Sign In
Handling mysql errors with active record
#1

[eluser]BlueCamel[/eluser]
How do you handle mysql records from active record? Is there a small example available? In my Lib I have the following:


Code:
function section_add( $param )
{
    $this->CI->db->insert( $param );
    return $this->CI->db->insert_id();
}

So I'm thinking if the insert fails it would be nice to catch and handle the mysql error. I'm a little lost on where I add the error checking in here. Can I expect the insert to return FALSE? What about the error code and error string from mysql?

Thanks.


Messages In This Thread
Handling mysql errors with active record - by El Forum - 01-17-2008, 06:42 AM
Handling mysql errors with active record - by El Forum - 01-17-2008, 02:01 PM
Handling mysql errors with active record - by El Forum - 01-17-2008, 08:29 PM
Handling mysql errors with active record - by El Forum - 03-14-2008, 04:34 AM
Handling mysql errors with active record - by El Forum - 03-14-2008, 06:29 AM
Handling mysql errors with active record - by El Forum - 03-14-2008, 08:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB