Merge pull request #1487 from IT-Can/query-error-sql-log

[Database] Extra debug info when there is a Query error.
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index d056bdb..28d665f 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -352,7 +352,7 @@
 			$error = $this->error();
 
 			// Log errors
-			log_message('error', 'Query error: '.$error['message']);
+			log_message('error', 'Query error: '.$error['message'] . ' - Invalid query: ' . $sql);
 
 			if ($this->db_debug)
 			{