summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2011-09-06 20:40:34 +0200
committerTimothy Warren <tim@timshomepage.net>2011-09-06 20:40:34 +0200
commitf22ce8f368e64b1c343e06427e8dad1ab1cef2a4 (patch)
treef0552e9318a541e82c3375646fc870490d835e12 /system/database/DB_driver.php
parent36fb8de7bf385036f3145dd1fbd9537f6a01ac36 (diff)
parent40d1a7684444f6a8eb4cda23d8822f0b258f0c3e (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index f9bf118fb..f3c6e41ad 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,