diff options
Diffstat (limited to 'engine/database/MySQLConnection.php')
-rw-r--r-- | engine/database/MySQLConnection.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engine/database/MySQLConnection.php b/engine/database/MySQLConnection.php index 9b473cb..c4e47e5 100644 --- a/engine/database/MySQLConnection.php +++ b/engine/database/MySQLConnection.php @@ -17,7 +17,10 @@ class MySQLConnection extends CommonDatabase { public function connect(): bool { $this->link = new mysqli(); - return !!$this->link->real_connect($this->host, $this->user, $this->password, $this->database); + $result = $this->link->real_connect($this->host, $this->user, $this->password, $this->database); + if ($result) + $this->link->set_charset('utf8mb4'); + return !!$result; } public function query(string $sql, ...$args): mysqli_result|bool { |