fixes #384 use built-in functions to set charset

This commit is contained in:
plegall 2015-12-08 13:39:09 +01:00
parent 5be28962a1
commit 16f6a54fa7
2 changed files with 5 additions and 3 deletions

View file

@ -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;
}
?>
?>