Skip to content

Commit

Permalink
- Bugfix: use table prefix in comment module updates. Patch by Bart.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuytaert committed Aug 13, 2003
1 parent 4880503 commit 626eeb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions update.php
Expand Up @@ -273,12 +273,12 @@ function update_58() {

function update_59() {

update_sql("ALTER TABLE comments ADD thread VARCHAR(255) NOT NULL");
update_sql("ALTER TABLE {comments} ADD thread VARCHAR(255) NOT NULL");

$result = db_query("SELECT DISTINCT(nid) FROM comments WHERE thread = ''");
$result = db_query("SELECT DISTINCT(nid) FROM {comments} WHERE thread = ''");

while ($node = db_fetch_object($result)) {
$result2 = db_query("SELECT cid, pid FROM comments where nid = '%d' ORDER BY timestamp", $node->nid);
$result2 = db_query("SELECT cid, pid FROM {comments} where nid = '%d' ORDER BY timestamp", $node->nid);
$comments = array();
while ($comment = db_fetch_object($result2)) {
$comments[$comment->cid] = $comment;
Expand All @@ -302,7 +302,7 @@ function update_59() {
}
$thread = implode(".", $new_parts);

db_query("UPDATE comments SET thread = '%s' WHERE cid = '%d'", $thread."/", $comments[$cid]->cid);
db_query("UPDATE {comments} SET thread = '%s' WHERE cid = '%d'", $thread."/", $comments[$cid]->cid);
}
}
}
Expand Down

0 comments on commit 626eeb4

Please sign in to comment.