Disable Foreign key checks
Set Time Zone git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@299 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
e2544b2998
commit
006ddc1ced
|
@ -7,7 +7,7 @@ function dump_table($table, $data = true) {
|
||||||
global $mysql;
|
global $mysql;
|
||||||
$result = $mysql->query("SHOW CREATE TABLE " . idf_escape($table));
|
$result = $mysql->query("SHOW CREATE TABLE " . idf_escape($table));
|
||||||
if ($result) {
|
if ($result) {
|
||||||
echo $mysql->result($result, 1) . ";\n\n"; //! export foreign keys after table definitions
|
echo $mysql->result($result, 1) . ";\n\n";
|
||||||
$result->free();
|
$result->free();
|
||||||
if ($data) {
|
if ($data) {
|
||||||
$result = $mysql->query("SELECT * FROM " . idf_escape($table)); //! enum and set as numbers, binary as _binary
|
$result = $mysql->query("SELECT * FROM " . idf_escape($table)); //! enum and set as numbers, binary as _binary
|
||||||
|
@ -17,9 +17,9 @@ function dump_table($table, $data = true) {
|
||||||
}
|
}
|
||||||
$result->free();
|
$result->free();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($mysql->server_info >= 5) {
|
if ($mysql->server_info >= 5) {
|
||||||
$result = $mysql->query("SHOW TRIGGERS LIKE '" . $mysql->escape_string(addcslashes($table, "%_")) . "'");
|
$result = $mysql->query("SHOW TRIGGERS LIKE '" . $mysql->escape_string(addcslashes($table, "%_")) . "'");
|
||||||
if ($result->num_rows) {
|
if ($result->num_rows) {
|
||||||
|
@ -73,6 +73,10 @@ function dump($db) {
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "SET FOREIGN_KEY_CHECKS = 0;\n";
|
||||||
|
echo "SET TIME_ZONE = '" . $mysql->escape_string($mysql->result($mysql->query("SELECT @@TIME_ZONE"))) . "';\n";
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
if (!strlen($_GET["db"])) {
|
if (!strlen($_GET["db"])) {
|
||||||
$result = $mysql->query("SHOW DATABASES");
|
$result = $mysql->query("SHOW DATABASES");
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
|
|
Loading…
Reference in a new issue