From 583f1c8d80c42195d0ee41f30a885e13d777b79f Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 08 Nov 2005 15:18:56 -0500
Subject: [PATCH] Added reply-to-all function (submitted by Julien Brette)

---
 program/include/rcube_db.inc |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/program/include/rcube_db.inc b/program/include/rcube_db.inc
index e835658..f13ab55 100755
--- a/program/include/rcube_db.inc
+++ b/program/include/rcube_db.inc
@@ -139,7 +139,7 @@
 			$result = $this->db_handle->limitQuery($query,$offset,$numrows,$params);
 			}
         else    
-			$result = $this->db_handle->query($query,$params);
+			$result = $this->db_handle->query($query, $params);
 
         if (DB::isError($result))
 			{
@@ -147,7 +147,7 @@
                               'type' => 'db',
                               'line' => __LINE__, 
                               'file' => __FILE__, 
-                              'message' => $result->getMessage()), TRUE, FALSE);
+                              'message' => $result->getMessage().'; QUERY: '.$query), TRUE, FALSE);
              return false;
             }
 
@@ -192,8 +192,11 @@
                 return $result;
                 
             case 'mysql': // This is unfortuneate
-                return mysql_insert_id();
+                return mysql_insert_id($this->db_handle->connection);
 
+			case 'mysqli':
+				return mysqli_insert_id($this->db_handle->connection);
+	
             case 'sqlite':
                 return sqlite_last_insert_rowid($this->db_handle->connection);
 
@@ -217,13 +220,29 @@
         return $result->fetchRow(DB_FETCHMODE_ASSOC);
     }
 
-	function quoteIdentifier ( $str )
+
+    function quote($input, $type=null)
+    {
+		if (!$this->db_handle)
+			$this->db_connect('r');
+
+		return $this->db_handle->quote($input);
+    }
+    
+
+	function quoteIdentifier($str)
 	{
 		if (!$this->db_handle)
 			$this->db_connect('r');
 			
 		return $this->db_handle->quoteIdentifier($str);
 	}
+	
+	function quote_identifier($str)
+	{
+		return $this->quoteIdentifier($str);
+	}
+
 	
 	function unixtimestamp($field)
 	{
@@ -289,11 +308,9 @@
     {
         if (!is_string($query))
             return ($query);
-
-        $search = array('/NOW\(\)/',
-                        '/`/');
-        $replace = array("datetime('now')",
-                         '"');
+            
+        $search = array('/NOW\(\)/i', '/`/');
+        $replace = array("datetime('now')", '"');
         $query = preg_replace($search, $replace, $query);
 
         return ($query);

--
Gitblit v1.9.1