Set character set right after connect
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@783 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
2c445a86c1
commit
70ade15c9f
|
@ -26,4 +26,3 @@ if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) |
|
||||||
connect_error(); // separate function to catch SQLite error
|
connect_error(); // separate function to catch SQLite error
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$dbh->query("SET CHARACTER SET utf8");
|
|
||||||
|
|
|
@ -207,6 +207,7 @@ function connect() {
|
||||||
$dbh = new Min_DB;
|
$dbh = new Min_DB;
|
||||||
if ($dbh->connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]])) {
|
if ($dbh->connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]])) {
|
||||||
$dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
|
$dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
|
||||||
|
$dbh->query("SET NAMES utf8");
|
||||||
return $dbh;
|
return $dbh;
|
||||||
}
|
}
|
||||||
return $dbh->error;
|
return $dbh->error;
|
||||||
|
|
|
@ -17,7 +17,6 @@ if (!$error && $_POST) {
|
||||||
$dbh2 = (strlen($_GET["db"]) ? connect() : null); // connection for exploring indexes (to not replace FOUND_ROWS()) //! PDO - silent error
|
$dbh2 = (strlen($_GET["db"]) ? connect() : null); // connection for exploring indexes (to not replace FOUND_ROWS()) //! PDO - silent error
|
||||||
if (is_object($dbh2)) {
|
if (is_object($dbh2)) {
|
||||||
$dbh2->select_db($_GET["db"]);
|
$dbh2->select_db($_GET["db"]);
|
||||||
$dbh2->query("SET CHARACTER SET utf8");
|
|
||||||
}
|
}
|
||||||
while (strlen($query)) {
|
while (strlen($query)) {
|
||||||
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
|
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
|
||||||
|
|
Loading…
Reference in a new issue