Try catch - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Try catch (/showthread.php?tid=17300) |
Try catch - El Forum - 04-01-2009 [eluser]bas_vdl[/eluser] i'm trying to do a try catch in my model but it is not working correctly when i remove the try catch and turn db debug van CI on then i get a duplicate key error so de try catch should show me a simiulair error. regards bas //query try { $query = $this->db->insert('cities', $data_city); //$result = ($this->db->affected_rows() == 1) ? TRUE : FALSE; } catch (Exception $e) { $result = $e->getMessage(); } Try catch - El Forum - 04-01-2009 [eluser]TheFuzzy0ne[/eluser] http://ellislab.com/forums/viewthread/110161/#555439 |