aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mssql_odbc.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/mssql_odbc.php')
-rw-r--r--phpBB/includes/db/mssql_odbc.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index de96939035..f79cd55af4 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -313,6 +313,37 @@ class dbal_mssql_odbc extends dbal
}
}
+ function sql_handle_data($type, $table, $data, $where = '')
+ {
+ if ($type === 'INSERT')
+ {
+ $stmt = odbc_prepare($this->db_connect_id, "INSERT INTO $table (". implode(', ', array_keys($data)) . ") VALUES (" . substr(str_repeat('?, ', sizeof($data)) ,0, -1) . ')');
+ }
+ else
+ {
+ $query = "UPDATE $table SET ";
+
+ $set = array();
+ foreach (array_keys($data) as $key)
+ {
+ $set[] = "$key = ?";
+ }
+ $query .= implode(', ', $set);
+
+ if ($where !== '')
+ {
+ $query .= $where;
+ }
+
+ $stmt = odbc_prepare($this->db_connect_id, $query);
+ }
+
+ // get the stmt onto the top of the function arguments
+ array_unshift($data, $stmt);
+
+ call_user_func_array('odbc_execute', $data);
+ }
+
/**
* Build LIKE expression
* @access private