From: Maryana Rozhankivska Date: Thu, 20 Feb 2014 08:41:16 +0000 (+0200) Subject: multiple tag entry displayed fix, issue #474 X-Git-Tag: 1.5.2^2~9^2~2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=e83cf5a7875d1387d79d1909050ff2eca9b4421a;p=github%2Fwallabag%2Fwallabag.git multiple tag entry displayed fix, issue #474 --- diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 3332b5a3..a366e866 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -345,7 +345,7 @@ class Database { } public function retrieveAllTags($user_id) { - $sql = "SELECT tags.* FROM tags + $sql = "SELECT DISTINCT tags.* FROM tags LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id LEFT JOIN entries ON tags_entries.entry_id=entries.id WHERE entries.user_id=?"; @@ -357,7 +357,7 @@ class Database { public function retrieveTag($id, $user_id) { $tag = NULL; - $sql = "SELECT tags.* FROM tags + $sql = "SELECT DISTINCT tags.* FROM tags LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id LEFT JOIN entries ON tags_entries.entry_id=entries.id WHERE tags.id=? AND entries.user_id=?";