Index: lib/ddl/sql_generator.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- lib/ddl/sql_generator.php (revision bd99cb90213b3195c7df14b30aa8060853489961) +++ lib/ddl/sql_generator.php (revision ) @@ -44,13 +44,13 @@ // To change any of them, do it in extended classes instead. /** @var string Used to quote names. */ - public $quote_string = '"'; + public $quote_string = '`'; /** @var string To be automatically added at the end of each statement. */ public $statement_end = ';'; /** @var bool To decide if we want to quote all the names or only the reserved ones. */ - public $quote_all = false; + public $quote_all = true; /** @var bool To create all the integers as NUMBER(x) (also called DECIMAL, NUMERIC...). */ public $integer_to_number = false; Index: lib/dml/mysqli_native_moodle_database.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- lib/dml/mysqli_native_moodle_database.php (revision bd99cb90213b3195c7df14b30aa8060853489961) +++ lib/dml/mysqli_native_moodle_database.php (revision ) @@ -1244,7 +1244,7 @@ throw new coding_exception('moodle_database::insert_record_raw() no fields found.'); } - $fields = implode(',', array_keys($params)); + $fields = '`'.implode('`,`', array_keys($params)).'`'; $qms = array_fill(0, count($params), '?'); $qms = implode(',', $qms); @@ -1471,7 +1471,7 @@ $sets = array(); foreach ($params as $field=>$value) { - $sets[] = "$field = ?"; + $sets[] = "`".$field."`"." = ?"; } $params[] = $id; // last ? in WHERE condition