Commit 15445a6d authored by Gábor Hojtsy's avatar Gábor Hojtsy

#180877 by Arancaytar: drupal_write_record() was not prefixing tables properly...

#180877 by Arancaytar: drupal_write_record() was not prefixing tables properly because PHP string parsing behavior
parent 560bd06f
......@@ -3098,7 +3098,7 @@ function drupal_write_record($table, &$object, $update = array()) {
// Build the SQL.
$query = '';
if (!count($update)) {
$query = "INSERT INTO {$table} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
$query = "INSERT INTO {". $table ."} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
$return = SAVED_NEW;
}
else {
......@@ -3115,7 +3115,7 @@ function drupal_write_record($table, &$object, $update = array()) {
$values[] = $object->$key;
}
$query = "UPDATE {$table} SET $query WHERE ". implode(' AND ', $conditions);
$query = "UPDATE {". $table ."} SET $query WHERE ". implode(' AND ', $conditions);
$return = SAVED_UPDATED;
}
db_query($query, $values);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment