aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/dblayer/functions_mysql.inc.php2
-rw-r--r--include/dblayer/functions_mysqli.inc.php6
2 files changed, 5 insertions, 3 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php
index a1853b223..9cf25e76f 100644
--- a/include/dblayer/functions_mysql.inc.php
+++ b/include/dblayer/functions_mysql.inc.php
@@ -53,7 +53,7 @@ function pwg_db_check_charset()
{
$db_charset = DB_CHARSET;
}
- pwg_query('SET NAMES "'.$db_charset.'"');
+ mysql_set_charset($db_charset);
}
function pwg_db_check_version()
diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php
index 390cf2e06..f9590c1d1 100644
--- a/include/dblayer/functions_mysqli.inc.php
+++ b/include/dblayer/functions_mysqli.inc.php
@@ -80,12 +80,14 @@ function pwg_db_connect($host, $user, $password, $database)
*/
function pwg_db_check_charset()
{
+ global $mysqli;
+
$db_charset = 'utf8';
if (defined('DB_CHARSET') and DB_CHARSET != '')
{
$db_charset = DB_CHARSET;
}
- pwg_query('SET NAMES "'.$db_charset.'"');
+ $mysqli->set_charset($db_charset);
}
/**
@@ -901,4 +903,4 @@ function query2array($query, $key_name=null, $value_name=null)
return $data;
}
-?> \ No newline at end of file
+?>