diff options
author | Derek Jones <derek.jones@ellislab.com> | 2011-08-31 21:18:48 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2011-08-31 21:18:48 +0200 |
commit | 47a62548cfdcd5fb6588a2caa92d3b55ac05de6f (patch) | |
tree | b1952e3cbfde4e1baf605526a573d112a4bc819d /system/database/DB_driver.php | |
parent | bbf2853c351425ea75f43599c3b229a8c323448c (diff) | |
parent | ef26dfcb705521be0ad85b00fdb735299bdd02d2 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index f3e824daa..300ca2977 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -251,9 +251,10 @@ class CI_DB_driver { { if ($sql == '') { + log_message('error', 'Invalid query: '.$sql); + if ($this->db_debug) { - log_message('error', 'Invalid query: '.$sql); return $this->display_error('db_invalid_query'); } return FALSE; @@ -306,21 +307,23 @@ class CI_DB_driver { // This will trigger a rollback if transactions are being used $this->_trans_status = FALSE; + // Grab the error number and message now, as we might run some + // additional queries before displaying the error + $error_no = $this->_error_number(); + $error_msg = $this->_error_message(); + + // Log errors + log_message('error', 'Query error: '.$error_msg); + if ($this->db_debug) { - // grab the error number and message now, as we might run some - // additional queries before displaying the error - $error_no = $this->_error_number(); - $error_msg = $this->_error_message(); - // We call this function in order to roll-back queries // if transactions are enabled. If we don't call this here // the error message will trigger an exit, causing the // transactions to remain in limbo. $this->trans_complete(); - // Log and display errors - log_message('error', 'Query error: '.$error_msg); + // Display errors return $this->display_error( array( 'Error Number: '.$error_no, |