From 60a4a64943a933f7b07c4c3c9ed9cca8c04d7ea8 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Wed, 30 Nov 2016 13:01:42 +0100 Subject: [PATCH] =?UTF-8?q?WHERE-Klausel=20f=C3=BCr=20suche=20nach=20Tags?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/tags.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/tags.class.php b/include/tags.class.php index 4961e5862..0d983a9e5 100644 --- a/include/tags.class.php +++ b/include/tags.class.php @@ -55,9 +55,16 @@ class tags extends basis_db * * Gibt alle Tags zurück */ - public function getAll() + public function getAll($tag_search = null) { - $qry = "SELECT * FROM public.tbl_tag; "; + $matchcode=mb_strtoupper(str_replace(array('<','>',' ',';','*','_','-',',',"'",'"'),"%",$tag_search)); + $qry = "SELECT * FROM public.tbl_tag "; + + if (!empty($tag_search)) + { + $qry.="WHERE UPPER(trim(public.tbl_tag.tag)) like '%".$this->db_escape($matchcode)."%' "; + } + $qry.="ORDER BY UPPER(trim(public.tbl_tag.tag)) "; if($this->db_query($qry)) {