aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-xinc/poche/Database.class.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 6f5c9ac0..2257f281 100755
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -389,12 +389,13 @@ class Database {
389 return $this->getHandle()->lastInsertId($column); 389 return $this->getHandle()->lastInsertId($column);
390 } 390 }
391 391
392 public function search($term){ 392 public function search($term,$id,$limit = ''){
393 $search = '%'.$term.'%'; 393 $search = '%'.$term.'%';
394 $query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ? OR title LIKE ? OR url LIKE ?"); //searches in content, title and URL 394 $sql_action = ("SELECT * FROM entries WHERE user_id=? AND (content LIKE ? OR title LIKE ? OR url LIKE ?) "); //searches in content, title and URL
395 $query->execute(array($search,$search,$search)); 395 $sql_action .= $this->getEntriesOrder().' ' . $limit;
396 $entries = $query->fetchAll(); 396 $params_action = array($id,$search,$search,$search);
397 return $entries; 397 $query = $this->executeQuery($sql_action, $params_action);
398 return $query->fetchAll();
398 } 399 }
399 400
400 public function retrieveAllTags($user_id, $term = null) { 401 public function retrieveAllTags($user_id, $term = null) {