]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Finished search engine function
authortcit <tcit@tcit.fr>
Wed, 26 Mar 2014 15:36:42 +0000 (16:36 +0100)
committertcit <tcit@tcit.fr>
Wed, 26 Mar 2014 15:36:42 +0000 (16:36 +0100)
Now searches also in title and in original url

inc/poche/Database.class.php

index 6aad16c11e16d3e0ac6f71d1a110cf42ecdfee45..6f5c9ac04755deb5fa0ed1679aa22a9f8dfde981 100755 (executable)
@@ -391,8 +391,8 @@ class Database {
        
        public function search($term){
                $search = '%'.$term.'%';
-               $query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ?");
-               $query->execute(array($search));
+               $query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ? OR title LIKE ? OR url LIKE ?"); //searches in content, title and URL
+               $query->execute(array($search,$search,$search));
                $entries = $query->fetchAll();
                return $entries;
        }