mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 17:44:07 +02:00
Specify quoting charset in PDO_MySQL
This commit is contained in:
@@ -211,8 +211,8 @@ if (!defined("DRIVER")) {
|
|||||||
var $extension = "PDO_MySQL";
|
var $extension = "PDO_MySQL";
|
||||||
|
|
||||||
function connect($server, $username, $password) {
|
function connect($server, $username, $password) {
|
||||||
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
|
$this->dsn("mysql:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
|
||||||
$this->query("SET NAMES utf8"); // charset in DSN is ignored
|
$this->query("SET NAMES utf8"); // charset in DSN is ignored before PHP 5.3.6
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user