Index: database/updates.inc =================================================================== RCS file: /cvs/drupal/drupal/database/updates.inc,v retrieving revision 1.66.2.2 diff -u -F^f -r1.66.2.2 updates.inc --- database/updates.inc 5 Jan 2005 20:17:33 -0000 1.66.2.2 +++ database/updates.inc 25 Mar 2005 13:46:51 -0000 @@ -89,6 +89,18 @@ "2004-12-20" => "update_110" ); +function update_sql($sql) { + $args = func_get_args(); + array_shift($args); + $result = db_query($sql, $args); + if ($result) { + return array('1', nl2br(htmlentities($sql)) ." ", "
OK
\n"); + } + else { + return array('0', nl2br(htmlentities($sql)) ." ", "
FAILED
\n"); + } +} + function update_32() { $ret = array(); $ret[] = update_sql("ALTER TABLE users ADD index (sid(4))"); @@ -1915,21 +1927,10 @@ function update_110() { // fill table $comment_updates = db_query("SELECT c.nid, c.timestamp, c.name, c.uid, COUNT(c.nid) as comment_count FROM {comments} c INNER JOIN {node} n ON c.nid = n.nid WHERE c.status = 0 GROUP BY c.nid"); while ($comment_record = db_fetch_object($comment_updates)) { - $ret[] = update_sql("UPDATE {node_comment_statistics} SET comment_count = $comment_record->comment_count, last_comment_timestamp = $comment_record->timestamp, last_comment_name = '$comment_record->name', last_comment_uid = $comment_record->uid WHERE nid = $comment_record->nid"); + $ret[] = update_sql("UPDATE {node_comment_statistics} SET comment_count = $comment_record->comment_count, last_comment_timestamp = $comment_record->timestamp, last_comment_name = '%s', last_comment_uid = $comment_record->uid WHERE nid = $comment_record->nid", $comment_record->name); } return $ret; } -function update_sql($sql) { - $edit = $_POST["edit"]; - $result = db_query($sql); - if ($result) { - return array('1', nl2br(htmlentities($sql)) ." ", "
OK
\n"); - } - else { - return array('0', nl2br(htmlentities($sql)) ." ", "
FAILED
\n"); - } -} - ?>