CodeIgniter Forums
not catching DB errors while using PDO as driver - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: not catching DB errors while using PDO as driver (/thread-58303.html)



not catching DB errors while using PDO as driver - El Forum - 05-31-2013

[eluser]Unknown[/eluser]
I came across an issue where CI isn't reporting errors with incorrect update statements. I can write a query which clearly violates duplicate keys or has incorrect column names, yet CI gives no error whatsoever with

Code:
echo $this->db->_error_message(); //returns nothing
echo $this->db->_error_number();  //returns '0000'

However as soon as I change over to using mysql as the driver, I receive error messages.

I've even tried
Code:
$this->db->query(.... //violating statement
to bypass active record, and no luck with errors.

Is this a problem with PDO? Or are there additional config settings to change when using PDO?