Browse Source

Bug: could not use mysql reserved words for table names (e.g. 'Change')

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@547 a333f486-631f-4898-b8df-5754b55c2be0
romainq 15 years ago
parent
commit
46610ce808
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/dbobject.class.php

+ 1 - 1
core/dbobject.class.php

@@ -790,7 +790,7 @@ abstract class DBObject
 		if (count($aValuesToWrite) == 0) return false;
 
 		$sTable = MetaModel::DBGetTable($sTableClass);
-		$sInsertSQL = "INSERT INTO $sTable (".join(",", $aFieldsToWrite).") VALUES (".join(", ", $aValuesToWrite).")";
+		$sInsertSQL = "INSERT INTO `$sTable` (".join(",", $aFieldsToWrite).") VALUES (".join(", ", $aValuesToWrite).")";
 
 		$iNewKey = CMDBSource::InsertInto($sInsertSQL);
 		// Note that it is possible to have a key defined here, and the autoincrement expected, this is acceptable in a non root class