From 10a699759d4f106f29c077a6d65d3b8d212825e5 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 6 Nov 2005 19:26:45 +0000 Subject: Added localized messages to client and check form input --- program/include/rcube_mdb2.inc | 52 +++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) (limited to 'program/include/rcube_mdb2.inc') diff --git a/program/include/rcube_mdb2.inc b/program/include/rcube_mdb2.inc index f6fde8dd5..35973ad5d 100755 --- a/program/include/rcube_mdb2.inc +++ b/program/include/rcube_mdb2.inc @@ -102,39 +102,24 @@ 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) @@ -168,6 +153,7 @@ class rcube_db return $this->_add_result($result, $query); } + function num_rows($res_id=NULL) { if (!$this->db_handle) @@ -181,6 +167,7 @@ class rcube_db return FALSE; } + function affected_rows($res_id=NULL) { if (!$this->db_handle) @@ -189,6 +176,7 @@ class rcube_db return $this->db_handle->affectedRows(); } + function insert_id($sequence = '') { if (!$this->db_handle || $this->db_mode=='r') @@ -212,42 +200,44 @@ class rcube_db return $result->fetchRow(MDB2_FETCHMODE_ASSOC); } - function quoteIdentifier ( $str ) - - { + function quote($input, $type=null) + { if (!$this->db_handle) - $this->db_connect('r'); - + return $this->db_handle->quote($input, $type); + } + - return $this->db_handle->quoteIdentifier($str); + function quoteIdentifier($str) + { + if (!$this->db_handle) + $this->db_connect('r'); + return $this->db_handle->quoteIdentifier($str); } - - function unixtimestamp($field) + function quote_identifier($str) { + return $this->quoteIdentifier($str); + } - switch($this->db_provider) + 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) { // sql error occured -- cgit v1.2.3