aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorMaryana Rozhankivska <mariroz@mr.lviv.ua>2014-04-02 22:33:06 +0300
committerMaryana Rozhankivska <mariroz@mr.lviv.ua>2014-04-02 22:33:06 +0300
commita4585f7eaa74d5f705c1622ac2419ea1198a7aba (patch)
treee379b18cbd353a361e27696e222f178dfe257fa6 /inc/poche/Database.class.php
parent182faf2696b38502d4784efc3f84f2f00290343f (diff)
parentd967a1fa14237648fc63c44f6a28c9c077b3e1bc (diff)
downloadwallabag-a4585f7eaa74d5f705c1622ac2419ea1198a7aba.tar.gz
wallabag-a4585f7eaa74d5f705c1622ac2419ea1198a7aba.tar.zst
wallabag-a4585f7eaa74d5f705c1622ac2419ea1198a7aba.zip
import without cron
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-xinc/poche/Database.class.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 9adb1644..6244df88 100755
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -407,14 +407,15 @@ class Database {
407 public function getLastId($column = '') { 407 public function getLastId($column = '') {
408 return $this->getHandle()->lastInsertId($column); 408 return $this->getHandle()->lastInsertId($column);
409 } 409 }
410 410
411 public function search($term){ 411 public function search($term, $user_id, $limit = '') {
412 $search = '%'.$term.'%'; 412 $search = '%'.$term.'%';
413 $query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ? OR title LIKE ? OR url LIKE ?"); //searches in content, title and URL 413 $sql_action = "SELECT * FROM entries WHERE user_id=? AND (content LIKE ? OR title LIKE ? OR url LIKE ?) "; //searches in content, title and URL
414 $query->execute(array($search,$search,$search)); 414 $sql_action .= $this->getEntriesOrder().' ' . $limit;
415 $entries = $query->fetchAll(); 415 $params_action = array($user_id, $search, $search, $search);
416 return $entries; 416 $query = $this->executeQuery($sql_action, $params_action);
417 } 417 return $query->fetchAll();
418 }
418 419
419 public function retrieveAllTags($user_id, $term = null) { 420 public function retrieveAllTags($user_id, $term = null) {
420 $sql = "SELECT DISTINCT tags.*, count(entries.id) AS entriescount FROM tags 421 $sql = "SELECT DISTINCT tags.*, count(entries.id) AS entriescount FROM tags