aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r--inc/poche/Database.class.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 86907e52..8e9ee0b7 100644
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -250,13 +250,21 @@ class Database {
250 return $this->getHandle()->lastInsertId($column); 250 return $this->getHandle()->lastInsertId($column);
251 } 251 }
252 252
253 public function retrieveAllTags() {
254 $sql = "SELECT * FROM tags";
255 $query = $this->executeQuery($sql, array());
256 $tags = $query->fetchAll();
257
258 return $tags;
259 }
260
253 public function retrieveTagsByEntry($entry_id) { 261 public function retrieveTagsByEntry($entry_id) {
254 $sql = 262 $sql =
255 "SELECT * FROM tags 263 "SELECT * FROM tags
256 LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id 264 LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id
257 WHERE tags_entries.entry_id = ?"; 265 WHERE tags_entries.entry_id = ?";
258 $query = $this->executeQuery($sql, array($entry_id)); 266 $query = $this->executeQuery($sql, array($entry_id));
259 $tags = $query->fetchAll(); 267 $tags = $query->fetchAll();
260 268
261 return $tags; 269 return $tags;
262 } 270 }