[add] function to get tags by entry

This commit is contained in:
Nicolas Lœuillet 2013-12-06 13:02:15 +01:00
parent 9e7c840b18
commit 5bea1a4d31

View File

@ -249,4 +249,15 @@ class Database {
public function getLastId($column = '') {
return $this->getHandle()->lastInsertId($column);
}
public function retrieveTagsByEntry($entry_id) {
$sql =
"SELECT * FROM tags
LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id
WHERE tags_entries.entry_id = ?";
$query = $this->executeQuery($sql, array($entry_id));
$tags = $query->fetchAll();
return $tags;
}
}