Simplify CREATE DATABASE condition
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@530 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
f78779bc3f
commit
9bbec6d02b
|
@ -23,7 +23,7 @@ if ($_POST) {
|
||||||
foreach ($_POST["databases"] as $db => $style) {
|
foreach ($_POST["databases"] as $db => $style) {
|
||||||
$db = bracket_escape($db, "back");
|
$db = bracket_escape($db, "back");
|
||||||
if ($mysql->select_db($db)) {
|
if ($mysql->select_db($db)) {
|
||||||
if ($_POST["format"] != "csv" && in_array($style, array("DROP, CREATE", "CREATE", "CREATE, ALTER")) && ($result = $mysql->query("SHOW CREATE DATABASE " . idf_escape($db)))) {
|
if ($_POST["format"] != "csv" && ereg('CREATE', $style)) && ($result = $mysql->query("SHOW CREATE DATABASE " . idf_escape($db)))) {
|
||||||
if ($style == "DROP, CREATE") {
|
if ($style == "DROP, CREATE") {
|
||||||
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
|
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue