Welcome Guest, Not a member yet? Register   Sign In
How to pass DB exception from Model across Controller and show in the view?
#1

[eluser]Soporte[/eluser]
Hello everybody,

anybody can help me with my problem. I don't know how show in the view the database exception.
In the model, I have the next code:

$result=$this->db->delete('lineatra', array('ip' => $ip));
$data = array();
if ($result==true){
$data['error']="";
}
else{
$data['error']=$this->db->_error_message();;
}
return $data;

and in the controller

$datos=$this->ventas->graba_lineas_facturas_modelo();
print $datos['error'];

But I don't know how show the error in the view.
Thanks in advance for any help !

Fernando
#2

[eluser]Unknown[/eluser]
I think it is because of the double ";" in the end of the error message syntax...




Theme © iAndrew 2016 - Forum software by © MyBB