[eluser]Noahs Arkive[/eluser]
CodeIgniter newbie...is there a way to handle DB exceptions within a Model using the database library? For example:
Code:
try {
$this->db->insert('users', $ary_fields);
return TRUE;
} catch(Exception $e){
return FALSE;
}
The code above does not intercept the Exception within the CI_DB_active_record class, so I see an uncaught exception if there's a primary key or unique index violation, for example.
Is there any way of catching a active record exception short of sub-classing CI_DB_active_record?
Thanks. BTW: Love CodeIgniter!
[quote author="Albert Einstein" date="1261772186"]The fear of death is the most unjustified of all fears, for there's no risk of accident for someone who's dead. [/quote]