From 917d2622aa5fe748c1cda914eae94c12be743c42 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 2 Mar 2023 02:17:52 +0300 Subject: support tables and emojies in markdown --- engine/database/MySQLConnection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engine/database') 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 { -- cgit v1.2.3