Added backticks to column names when using insert_string and update_string. Relates to this bug report: http://codeigniter.com/bug_tracker/bug/4509/
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 9d9b651..de372e6 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -398,6 +398,22 @@
{
return mysql_errno($this->conn_id);
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Escape Column Name
+ *
+ * This function adds backticks around supplied column name
+ *
+ * @access private
+ * @param string the column name
+ * @return string
+ */
+ function _escape_column($column)
+ {
+ return '`' .$column. '`';
+ }
// --------------------------------------------------------------------