diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index e3588a9cd5..5e8e0c9fdd 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -357,8 +357,20 @@ abstract class phpbb_dbal
* @param mixed $data The data to insert/update in an array (key == column, value == value)
* @param string $where An optional where-statement
* @access public
+ * @todo implement correctly by using types and only overwrite if DB supports prepared statements
*/
- abstract public function sql_handle_data($type, $table, $data, $where = '');
+ public function sql_handle_data($type, $table, $data, $where = '')
+ {
+ if ($type === 'UPDATE')
+ {
+ $where = ($where) ? ' WHERE ' . $where : '';
+ $this->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', $data) . $where);
+ }
+ else
+ {
+ $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $data));
+ }
+ }
/**
* DB-specific base query method. Called by {@link phpbb_dbal::sql_query() sql_query()}.
@@ -1080,7 +1092,10 @@ abstract class phpbb_dbal
if (!$this->return_on_error)
{
- $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]
' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']';
+ $sql_message = $this->sql_error_returned['message'];
+ $sql_code = $this->sql_error_returned['code'];
+
+ $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]' . (($sql_message) ? '
' . $sql_message : '') . (($sql_code) ? ' [' . $sql_code . ']' : '');
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 97a7c2a4ea..ac0384d523 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -71,6 +71,7 @@ class phpbb_dbal_mysql extends phpbb_dbal
$this->user = $user;
$this->server = $server . (($port) ? ':' . $port : '');
$this->dbname = $database;
+ $this->port = $port;
$this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $password, $new_link) : @mysql_connect($this->server, $this->user, $password, $new_link);
@@ -262,20 +263,10 @@ class phpbb_dbal_mysql extends phpbb_dbal
/**
* Handle data by using prepared statements. See {@link phpbb_dbal::sql_handle_data() sql_handle_data()} for details.
- * @todo implement correctly by using types. ;)
- */
public function sql_handle_data($type, $table, $data, $where = '')
{
- if ($type === 'UPDATE')
- {
- $where = ($where) ? ' WHERE ' . $where : '';
- $this->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', $data) . $where);
- }
- else
- {
- $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $data));
- }
}
+ */
/**
* Build DB-specific query bits. See {@link phpbb_dbal::_sql_custom_build() _sql_custom_build()} for details.
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index acd789b086..386efdbff0 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -258,8 +258,6 @@ class phpbb_dbal_mysqli extends phpbb_dbal
/**
* Handle data by using prepared statements. See {@link phpbb_dbal::sql_handle_data() sql_handle_data()} for details.
- * @todo implement correctly by using types. ;)
- */
public function sql_handle_data($type, $table, $data, $where = '')
{
if ($type === 'INSERT')
@@ -293,6 +291,7 @@ class phpbb_dbal_mysqli extends phpbb_dbal
mysqli_stmt_close($stmt);
}
+*/
/**
* Build DB-specific query bits. See {@link phpbb_dbal::_sql_custom_build() _sql_custom_build()} for details.