summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-07-09 20:39:42 +0400
committerAndrew Dolgov <[email protected]>2012-07-09 20:39:42 +0400
commitf360b02886e55c34737e930277b6b5d840c73566 (patch)
treec5170ce97a0b91b5c1dc2eb661bb0b1eb899263f /include
parentd3d69daa3cb4d5a2839bd20d48a939e0351264a6 (diff)
fix getLabelUnread (refs #464)
Diffstat (limited to 'include')
-rw-r--r--include/functions.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index 5b3cc6741..29b5d4677 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1579,8 +1579,8 @@
function getLabelUnread($link, $label_id, $owner_uid = false) {
if (!$owner_uid) $owner_uid = $_SESSION["uid"];
- $result = "SELECT COUNT(ref_id) FROM ttrss_user_entries, ttrss_user_labels2
- WHERE owner_uid = '$owner_uid' AND unread = true AND label_id = '$label_id' AND article_id = ref_id";
+ $result = db_query($link, "SELECT COUNT(ref_id) AS unread FROM ttrss_user_entries, ttrss_user_labels2
+ WHERE owner_uid = '$owner_uid' AND unread = true AND label_id = '$label_id' AND article_id = ref_id");
if (db_num_rows($result) != 0) {
return db_fetch_result($result, 0, "unread");