diff options
Diffstat (limited to 'includes/database/mysql')
-rw-r--r-- | includes/database/mysql/query.inc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc index 7ea0f20ce..58fc8eb22 100644 --- a/includes/database/mysql/query.inc +++ b/includes/database/mysql/query.inc @@ -45,7 +45,7 @@ class InsertQuery_mysql extends InsertQuery { $max_placeholder = 0; $values = array(); - if ($this->insertValues) { + if (count($this->insertValues)) { foreach ($this->insertValues as $insert_values) { $placeholders = array(); @@ -61,14 +61,11 @@ class InsertQuery_mysql extends InsertQuery { $values[] = '('. implode(', ', $placeholders) .')'; } } - elseif ($this->defaultFields) { + else { // If there are no values, then this is a default-only query. We still need to handle that. $placeholders = array_fill(0, count($this->defaultFields), 'default'); $values[] = '(' . implode(', ', $placeholders) .')'; } - else { - $values[] = '(default)'; - } $query .= implode(', ', $values); |