From: Andrew Dolgov Date: Tue, 13 Dec 2005 10:32:55 +0000 (+0100) Subject: fix getCategoryCounters() for categories with no unread messages X-Git-Tag: schema_freeze_for_1.1.1~48 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7160700cbf738093201b8015de8e8e58451a8aa1;p=tt-rss.git fix getCategoryCounters() for categories with no unread messages --- diff --git a/backend.php b/backend.php index 7df13c0a..a4d60417 100644 --- a/backend.php +++ b/backend.php @@ -68,7 +68,10 @@ function getCategoryCounters($link) { $result = db_query($link, "SELECT COUNT(int_id) AS unread,cat_id FROM ttrss_user_entries,ttrss_feeds WHERE unread = true AND feed_id = id - AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id"); + AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id + UNION + SELECT 0,cat_id FROM ttrss_feeds + WHERE ttrss_feeds.owner_uid = ".$_SESSION["uid"]." GROUP BY cat_id"); while ($line = db_fetch_assoc($result)) { $line["cat_id"] = sprintf("%d", $line["cat_id"]);