浏览代码

fixed Pdo - add quote

Piotr Labudda 8 年之前
父节点
当前提交
9d27a4bad2
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      SE/se-lib/Core/Pdo.php

+ 3 - 2
SE/se-lib/Core/Pdo.php

@@ -552,11 +552,12 @@ EOF_STRUCT_MYSQL;
 		$sqlFields = [];
 		$sqlValues = [];
 		foreach ($item as $field => $val) {
-			$sqlFields[] = "`{$field}`";
+			$sqlFields[] = $this->identifierQuote($field);
 			$sqlValues[] = $this->convertValueToSqlSafe($val, V::get($field, null, $sqlSchema));
 		}
+		$sqlTableName = $this->tableNameQuote($tableName);
 		$sql = "
-			insert into `{$tableName}` (" . implode(", ", $sqlFields) . ")
+			insert into {$sqlTableName} (" . implode(", ", $sqlFields) . ")
 				values (" . implode(", ", $sqlValues) . ")
 		";
 		$this->execSql($sql);