mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
Add helper function
This commit is contained in:
@@ -42,7 +42,7 @@ SET foreign_key_checks = 0;
|
||||
foreach ((array) $databases as $db) {
|
||||
$adminer->dumpDatabase($db);
|
||||
if ($connection->select_db($db)) {
|
||||
if ($is_sql && preg_match('~CREATE~', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
|
||||
if ($is_sql && preg_match('~CREATE~', $style) && ($create = get_val("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
|
||||
set_utf8mb4($create);
|
||||
if ($style == "DROP+CREATE") {
|
||||
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
|
||||
@@ -79,7 +79,7 @@ SET foreign_key_checks = 0;
|
||||
|
||||
if ($_POST["events"]) {
|
||||
foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) {
|
||||
$create = remove_definer($connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3));
|
||||
$create = remove_definer(get_val("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3));
|
||||
set_utf8mb4($create);
|
||||
$out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") . "$create;;\n\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user