alecpl
2008-10-07 af7a23d9d9fb983c4cacb7e4696eba904ecc537e
program/include/rcube_mdb2.php
@@ -69,17 +69,6 @@
  /**
   * PHP 4 object constructor
   *
   * @see  rcube_mdb2::__construct
   */
  function rcube_db($db_dsnw,$db_dsnr='')
    {
    $this->__construct($db_dsnw,$db_dsnr);
    }
  /**
   * Connect to specific database
   *
   * @param  string  DSN for DB connections
@@ -94,6 +83,8 @@
        'emulate_prepared' => $this->debug_mode,
        'debug' => $this->debug_mode,
        'debug_handler' => 'mdb2_debug_handler',
   'disable_smart_seqname' => true,    // for postgresql
   'seqname_format' => '%s',      // for postgresql
        'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL));
    if (MDB2::isError($dbh))
@@ -509,6 +500,27 @@
  /**
   * 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