diff options
| author | sparc <sparc@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-27 13:24:13 +0000 |
|---|---|---|
| committer | sparc <sparc@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-27 13:24:13 +0000 |
| commit | 9ae97d3e073db2d74b0c43b14d1a73c1df490153 (patch) | |
| tree | ea432884a42f7e8043ece2fe5ba6611ac0154afd /roundcubemail/program/include | |
| parent | ad32715fe346b4baf680238fd723cce6dad47b88 (diff) | |
more mdb2 integration
git-svn-id: https://svn.roundcube.net/trunk@64 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rwxr-xr-x | roundcubemail/program/include/rcube_mdb2.inc | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/roundcubemail/program/include/rcube_mdb2.inc b/roundcubemail/program/include/rcube_mdb2.inc index 53590aa0b..4637bede9 100755 --- a/roundcubemail/program/include/rcube_mdb2.inc +++ b/roundcubemail/program/include/rcube_mdb2.inc @@ -55,7 +55,7 @@ class rcube_db function dsn_connect($dsn) { // Use persistent connections if available - $dbh = MDB2::factory($dsn, array('persistent' => TRUE)); + $dbh = MDB2::factory($dsn, array('persistent' => $true)); if (PEAR::isError($dbh)) raise_error(array('code' => 500, @@ -104,37 +104,21 @@ class rcube_db // Query database function query() - { - $params = func_get_args(); - $query = array_shift($params); - - return $this->_query($query, 0, 0, $params); - } - - function limitquery() - { - $params = func_get_args(); - $query = array_shift($params); - $offset = array_shift($params); - $numrows = array_shift($params); - - return $this->_query($query, $offset, $numrows, $params); - } function _query($query, $offset, $numrows, $params) @@ -153,7 +137,7 @@ class rcube_db $this->db_handle->row_offset = $offset; $this->db_handle->row_limit = $numrows; - $result = $this->db_handle->query($query); + $result = $this->db_handle->query($query,$params); if (PEAR::isError($result)) raise_error(array('code' => 500, @@ -210,39 +194,23 @@ class rcube_db } function quoteIdentifier ( $str ) - { - if (!$this->db_handle) - $this->db_connect('r'); - - return $this->db_handle->quoteIdentifier($str); - } function unixtimestamp($field) - { - switch($this->db_provider) - { - case 'pgsql': - return "EXTRACT (EPOCH FROM $field)"; - break; - default: - return "UNIX_TIMESTAMP($field)"; - } - } function _add_result($res, $query) |
