mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +02:00
MySQL: Use utf8mb4 if available
This commit is contained in:
@@ -292,7 +292,9 @@ if (!defined("DRIVER")) {
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
$connection->set_charset("utf8"); // available in MySQLi since PHP 5.0.5
|
||||
$connection->set_charset( // available in MySQLi since PHP 5.0.5
|
||||
version_compare($connection->server_info, "5.5.3") > 0 ? "utf8mb4" : "utf8" // SHOW CHARSET would require an extra query
|
||||
);
|
||||
$connection->query("SET sql_quote_show_create = 1, autocommit = 1");
|
||||
return $connection;
|
||||
}
|
||||
|
Reference in New Issue
Block a user