aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/privmsg.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-23 17:49:13 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-23 17:49:13 +0000
commitaca19b4d0d77061f6502b3b48e239b10c927f785 (patch)
treef5fcb4453c39975c68fd23ef74ddb7262b669041 /phpBB/privmsg.php
parentbab63286849dcba4779c8d6a65ef1d749b191ab0 (diff)
downloadforums-aca19b4d0d77061f6502b3b48e239b10c927f785.tar
forums-aca19b4d0d77061f6502b3b48e239b10c927f785.tar.gz
forums-aca19b4d0d77061f6502b3b48e239b10c927f785.tar.bz2
forums-aca19b4d0d77061f6502b3b48e239b10c927f785.tar.xz
forums-aca19b4d0d77061f6502b3b48e239b10c927f785.zip
Fix SQL problem bug #520293
git-svn-id: file:///svn/phpbb/trunk@2202 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/privmsg.php')
-rw-r--r--phpBB/privmsg.php26
1 files changed, 16 insertions, 10 deletions
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index 422436047e..dda275ee4f 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -698,12 +698,15 @@ else if( ( $delete && $mark_list ) || $delete_all )
$update_pm_sql .= ( ( $update_pm_sql != "" ) ? ", " : "" ) . $row['privmsgs_to_userid'];
}
- $sql = "UPDATE " . USERS_TABLE . "
- SET user_new_privmsg = user_new_privmsg - 1
- WHERE user_id IN ($update_pm_sql)";
- if ( !($result = $db->sql_query($sql)) )
+ if ( $update_pm_sql != "" )
{
- message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET user_new_privmsg = user_new_privmsg - 1
+ WHERE user_id IN ($update_pm_sql)";
+ if ( !($result = $db->sql_query($sql)) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ }
}
$sql = "SELECT privmsgs_to_userid
@@ -722,12 +725,15 @@ else if( ( $delete && $mark_list ) || $delete_all )
$update_pm_sql .= ( ( $update_pm_sql != "" ) ? ", " : "" ) . $row['privmsgs_to_userid'];
}
- $sql = "UPDATE " . USERS_TABLE . "
- SET user_unread_privmsg = user_unread_privmsg - 1
- WHERE user_id IN ($update_pm_sql)";
- if ( !($result = $db->sql_query($sql)) )
+ if ( $update_pm_sql != "" )
{
- message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET user_unread_privmsg = user_unread_privmsg - 1
+ WHERE user_id IN ($update_pm_sql)";
+ if ( !($result = $db->sql_query($sql)) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ }
}
}