summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 306f09d7d..a0833d0ce 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -308,18 +308,23 @@ class CI_DB_driver {
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: '.$this->_error_message());
return $this->display_error(
array(
- 'Error Number: '.$this->_error_number(),
- $this->_error_message(),
+ 'Error Number: '.$error_no,
+ $error_msg,
$sql
)
);