X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FDatabase.class.php;h=04731821fb3311a6cd0e6180bfe5d8bc4ec9ebdb;hb=a562e3905ac67983b85853e5ace813b2de0e3807;hp=afe02a41e955a66e34bebf59f37129df76fd7539;hpb=da5fc42f615eeb45a702604970f94967507fb432;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index afe02a41..04731821 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -81,7 +81,7 @@ class Database { if (STORAGE == 'sqlite') { $sql = ' - CREATE TABLE tags_entries ( + CREATE TABLE IF NOT EXISTS tags_entries ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, entry_id INTEGER, tag_id INTEGER, @@ -337,7 +337,7 @@ class Database { public function retrieveEntriesByTag($tag_id) { $sql = - "SELECT * FROM entries + "SELECT entries.* FROM entries LEFT JOIN tags_entries ON tags_entries.entry_id=entries.id WHERE tags_entries.tag_id = ?"; $query = $this->executeQuery($sql, array($tag_id)); @@ -348,7 +348,7 @@ class Database { public function retrieveTagsByEntry($entry_id) { $sql = - "SELECT * FROM tags + "SELECT tags.* 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));