Hi,
In my application I have some database insert/update operations that are triggered by ajax calling the appropriate controller.
If the query is successful the model returns:
or if it fails it returns:
PHP Code:
$data['result'] = 0;
$data['err'] = $this->db->_error_number();
$data['msg'] = $this->db->_error_message();
$data['query'] = $this->db->last_query();
Controller return this as a json string, and then I want to handle those in my own way from the front-end.
I have set the db_debug in database config file to false, but when the query fails for any reason I just get the PHP error page being returned with the below message, which obviously hangs the ajax request because it is expecting json data, and even if I set it to html I would still get a CI PHP error messages.
Quote:Message: pg_query(): Query failed: ERROR:.....
How can I simply return the database errors without displaying the PHP error pages?