diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-09 20:20:59 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-09 20:20:59 +0000 |
| commit | cdb1d39e62ad221298f2351d7a6ea4cb7271fceb (patch) | |
| tree | 68a34433e6c53a129cda5e4d9c56528dbcea7a02 /roundcubemail/program/include/rcube_mdb2.php | |
| parent | d049247fbba28a96ffc7b8c9469c05b447007d12 (diff) | |
- Case insensitive contacts searching using PostgreSQL (#1485259)
git-svn-id: https://svn.roundcube.net/trunk@1637 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_mdb2.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_mdb2.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_mdb2.php b/roundcubemail/program/include/rcube_mdb2.php index 9f2f30c10..0adb6e293 100644 --- a/roundcubemail/program/include/rcube_mdb2.php +++ b/roundcubemail/program/include/rcube_mdb2.php @@ -509,6 +509,27 @@ class rcube_mdb2 /** + * 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) + { + // TODO: use MDB2's matchPattern() function + 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 |
