Welcome Guest, Not a member yet? Register   Sign In
Try catch
#1

[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();
}
#2

[eluser]TheFuzzy0ne[/eluser]
http://ellislab.com/forums/viewthread/110161/#555439




Theme © iAndrew 2016 - Forum software by © MyBB