From cc60cbbbabba932648cfe35ca1ae8b7ddba1186c Mon Sep 17 00:00:00 2001 From: tcit Date: Wed, 26 Mar 2014 16:36:42 +0100 Subject: [PATCH] Finished search engine function Now searches also in title and in original url --- inc/poche/Database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 6aad16c1..6f5c9ac0 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -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; } -- 2.41.0