aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-12-31 22:00:59 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-12-31 22:00:59 +0000
commita329802431f744e7e8c93de30be27ec93397d12b (patch)
tree5d7ff7060be9e7c0cb227f0e6eba95048fd131e6
parent2f32f10343846d27be4f02c43adc7e4941c8f762 (diff)
downloadforums-a329802431f744e7e8c93de30be27ec93397d12b.tar
forums-a329802431f744e7e8c93de30be27ec93397d12b.tar.gz
forums-a329802431f744e7e8c93de30be27ec93397d12b.tar.bz2
forums-a329802431f744e7e8c93de30be27ec93397d12b.tar.xz
forums-a329802431f744e7e8c93de30be27ec93397d12b.zip
Fix bug #498194
git-svn-id: file:///svn/phpbb/trunk@1757 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/upgrade.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/phpBB/upgrade.php b/phpBB/upgrade.php
index ad1c7eb785..3b53275875 100644
--- a/phpBB/upgrade.php
+++ b/phpBB/upgrade.php
@@ -1216,18 +1216,23 @@ if( !empty($next) )
WHERE u.user_id IS NULL";
$result = query($sql, "Couldn't obtain list of deleted users");
- $post_id_ary = array();
- while( $row = $db->sql_fetchrow($result) )
+ $users_removed = $db->sql_numrows($result);
+
+ if( $users_removed )
{
- $post_id_ary[] = $row['post_id'];
- }
+ $post_id_ary = array();
+ while( $row = $db->sql_fetchrow($result) )
+ {
+ $post_id_ary[] = $row['post_id'];
+ }
- $sql = "UPDATE " . POSTS_TABLE . "
- SET poster_id = " . ANONYMOUS . ", enable_sig = 0
- WHERE post_id IN (" . implode(", ", $post_id_ary) . ")";
- query($sql, "Couldn't update posts to remove deleted user poster_id values");
+ $sql = "UPDATE " . POSTS_TABLE . "
+ SET poster_id = " . ANONYMOUS . ", enable_sig = 0
+ WHERE post_id IN (" . implode(", ", $post_id_ary) . ")";
+ query($sql, "Couldn't update posts to remove deleted user poster_id values");
+ }
- print "Done<br />\n";
+ print "Removed $users_removed Users ... Done<br />\n";
echo "<br />Complete<br />\n";
end_step('convert_pm');