From cdb1d39e62ad221298f2351d7a6ea4cb7271fceb Mon Sep 17 00:00:00 2001 From: alec Date: Sat, 9 Aug 2008 20:20:59 +0000 Subject: - Case insensitive contacts searching using PostgreSQL (#1485259) git-svn-id: https://svn.roundcube.net/trunk@1637 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_db.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'roundcubemail/program/include/rcube_db.php') diff --git a/roundcubemail/program/include/rcube_db.php b/roundcubemail/program/include/rcube_db.php index 8fa34e6a5..716e0d9bf 100644 --- a/roundcubemail/program/include/rcube_db.php +++ b/roundcubemail/program/include/rcube_db.php @@ -510,6 +510,26 @@ class rcube_db } + /** + * Return SQL statement for case insensitive LIKE + * + * @param string Field name + * @param string Search value + * @return string SQL statement to use in query + * @access public + */ + function ilike($column, $value) + { + switch($this->db_provider) + { + case 'pgsql': + return $this->quote_identifier($column).' ILIKE '.$this->quote($value); + default: + return $this->quote_identifier($column).' LIKE '.$this->quote($value); + } + } + + /** * Adds a query result and returns a handle ID * -- cgit v1.2.3