1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-12-24 00:08:57 -05:00

Finished search engine function

Now searches also in title and in original url
This commit is contained in:
tcit 2014-03-26 16:36:42 +01:00
parent d619120fc4
commit cc60cbbbab

View File

@ -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;
}