Prevent warning of set_charset #291
This commit is contained in:
parent
b8caf48d7d
commit
38a8e9840b
@ -20,8 +20,8 @@ class Database extends Module {
|
|||||||
if ($database->connect_errno) exit('Error: ' . $database->connect_error);
|
if ($database->connect_errno) exit('Error: ' . $database->connect_error);
|
||||||
|
|
||||||
# Avoid sql injection on older MySQL versions by using GBK
|
# Avoid sql injection on older MySQL versions by using GBK
|
||||||
if ($database->server_version<50500) $database->set_charset('GBK');
|
if ($database->server_version<50500) @$database->set_charset('GBK');
|
||||||
else $database->set_charset('utf8');
|
else @$database->set_charset('utf8');
|
||||||
|
|
||||||
# Set unicode
|
# Set unicode
|
||||||
$database->query('SET NAMES utf8;');
|
$database->query('SET NAMES utf8;');
|
||||||
|
Loading…
Reference in New Issue
Block a user