diff options
-rw-r--r-- | phpBB/db/mysql.php | 5 | ||||
-rw-r--r-- | phpBB/db/mysql4.php | 5 | ||||
-rw-r--r-- | phpBB/posting.php | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/db/mysql.php b/phpBB/db/mysql.php index fe2e93fee5..1898d0ce91 100644 --- a/phpBB/db/mysql.php +++ b/phpBB/db/mysql.php @@ -234,7 +234,7 @@ class sql_db } } - $query = $query . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')'; + $query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')'; } else if ($query == 'UPDATE') { @@ -254,9 +254,10 @@ class sql_db $values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var"; } } + $query = implode(', ', $values); } - return implode(', ', $values); + return $query; } // diff --git a/phpBB/db/mysql4.php b/phpBB/db/mysql4.php index a03216503c..921db44ba5 100644 --- a/phpBB/db/mysql4.php +++ b/phpBB/db/mysql4.php @@ -234,7 +234,7 @@ class sql_db } } - $query = $query . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')'; + $query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')'; } else if ($query == 'UPDATE') { @@ -254,9 +254,10 @@ class sql_db $values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var"; } } + $query = implode(', ', $values); } - return implode(', ', $values); + return $query; } // diff --git a/phpBB/posting.php b/phpBB/posting.php index 00ea5387e7..8da84974bb 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -416,7 +416,7 @@ if (isset($post)) )); } $topic_replies_sql = ($mode == 'reply') ? ', topic_replies = topic_replies + 1' : ''; - $sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $forum_sql) . $topic_replies_sql . ' . WHERE topic_id = ' . intval($topic_id); + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $topic_sql) . $topic_replies_sql . ' WHERE topic_id = ' . intval($topic_id); $db->sql_query($sql); // Update user post count ... if appropriate |