diff options
author | Esen Sagynov <kadishmal@gmail.com> | 2011-08-10 12:22:58 +0200 |
---|---|---|
committer | Esen Sagynov <kadishmal@gmail.com> | 2011-08-10 12:22:58 +0200 |
commit | ee3e594893d28ca6370d24d2a4406c1897959175 (patch) | |
tree | 2bd315780665c274734222d07613a950e947688a /system/database/drivers/cubrid/cubrid_driver.php | |
parent | 2e08794d5de57d727abb2abe752a4479b3ec0242 (diff) |
Added field name wrappers (") in insert/update/replace/_process_fields/_create_table functions to avoid reserved word conflicts.
Diffstat (limited to 'system/database/drivers/cubrid/cubrid_driver.php')
-rw-r--r-- | system/database/drivers/cubrid/cubrid_driver.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index ef0b5b451..9b5d86aa6 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -545,7 +545,7 @@ class CI_DB_cubrid_driver extends CI_DB */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (\"".implode('\", \"', $keys)."\") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -564,7 +564,7 @@ class CI_DB_cubrid_driver extends CI_DB */ function _replace($table, $keys, $values) { - return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -582,7 +582,7 @@ class CI_DB_cubrid_driver extends CI_DB */ function _insert_batch($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values); } // -------------------------------------------------------------------- @@ -605,7 +605,7 @@ class CI_DB_cubrid_driver extends CI_DB { foreach ($values as $key => $val) { - $valstr[] = $key . ' = ' . $val; + $valstr[] = sprintf('"%s" = %s', $key, $val); } $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |