diff options
author | gpolins <gpolins@users.sourceforge.net> | 2001-08-17 22:40:49 +0000 |
---|---|---|
committer | gpolins <gpolins@users.sourceforge.net> | 2001-08-17 22:40:49 +0000 |
commit | ea1f0debe652e633a7681220883d368df662db28 (patch) | |
tree | 48befae730ca592ec5196c8ca91e82ae004c0eb6 | |
parent | edd5b78b36fcf91c2abdf6028f30952340316042 (diff) | |
download | forums-ea1f0debe652e633a7681220883d368df662db28.tar forums-ea1f0debe652e633a7681220883d368df662db28.tar.gz forums-ea1f0debe652e633a7681220883d368df662db28.tar.bz2 forums-ea1f0debe652e633a7681220883d368df662db28.tar.xz forums-ea1f0debe652e633a7681220883d368df662db28.zip |
Fixed bug in updating forum last post
git-svn-id: file:///svn/phpbb/trunk@900 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/modcp.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/modcp.php b/phpBB/modcp.php index 158be55059..44b524baa7 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -243,11 +243,17 @@ switch($mode) { message_die(GENERAL_ERROR, "Could not get last post id", "Error", __LINE__, __FILE__, $sql); } - $last_post = $db->sql_fetchrowset($result); + $last_post_row = $db->sql_fetchrowset($result); + $last_post = $last_post_row[0]['last_post']; + if($last_post == "") + { + $last_post = 'NULL'; + } $update_index = "UPDATE ".FORUMS_TABLE." SET forum_topics = forum_topics - $topics_removed, forum_posts = forum_posts - $posts_removed, - forum_last_post_id = ".$last_post[0]['last_post']." WHERE forum_id = $forum_id"; + forum_last_post_id = $last_post + WHERE forum_id = $forum_id"; if(!$result = $db->sql_query($update_index, END_TRANSACTION)) { message_die(GENERAL_ERROR, "Could not update index!", "Error", __LINE__, __FILE__, $update_index); |