diff options
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-x | inc/poche/Database.class.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 5b51b507..6aad16c1 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -388,6 +388,14 @@ class Database { | |||
388 | public function getLastId($column = '') { | 388 | public function getLastId($column = '') { |
389 | return $this->getHandle()->lastInsertId($column); | 389 | return $this->getHandle()->lastInsertId($column); |
390 | } | 390 | } |
391 | |||
392 | public function search($term){ | ||
393 | $search = '%'.$term.'%'; | ||
394 | $query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ?"); | ||
395 | $query->execute(array($search)); | ||
396 | $entries = $query->fetchAll(); | ||
397 | return $entries; | ||
398 | } | ||
391 | 399 | ||
392 | public function retrieveAllTags($user_id, $term = null) { | 400 | public function retrieveAllTags($user_id, $term = null) { |
393 | $sql = "SELECT DISTINCT tags.*, count(entries.id) AS entriescount FROM tags | 401 | $sql = "SELECT DISTINCT tags.*, count(entries.id) AS entriescount FROM tags |