diff options
author | alecpl <alec@alec.pl> | 2008-08-09 20:20:59 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-08-09 20:20:59 +0000 |
commit | d8d41658d3fb87c71c3e30825003f827f4ffbdae (patch) | |
tree | 75f62e9e697d54685802eee6bfa5d9cb968ac4b2 /program/include/rcube_db.php | |
parent | 06776305af9b08876533c46e8493c2759d66f747 (diff) |
- Case insensitive contacts searching using PostgreSQL (#1485259)
Diffstat (limited to 'program/include/rcube_db.php')
-rw-r--r-- | program/include/rcube_db.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/program/include/rcube_db.php b/program/include/rcube_db.php index 8fa34e6a5..716e0d9bf 100644 --- a/program/include/rcube_db.php +++ b/program/include/rcube_db.php @@ -511,6 +511,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 * * @param object Query handle |