diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index c7ca3d50..733f4a7f 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -135,6 +135,8 @@ if (!$error && $_POST) { if ($warnings && $warnings->num_rows) { $time .= ", " . lang('Warnings') . "" . script("qsl('a').onclick = partial(toggle, '$warnings_id');", ""); } + $explain = null; + $explain_id = "explain-$commands"; if (is_object($result)) { $limit = $_POST["limit"]; $orgtables = select($result, $connection2, array(), $limit); @@ -143,23 +145,17 @@ if (!$error && $_POST) { $num_rows = $result->num_rows; echo "
" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
echo $time;
+ if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
+ echo ", EXPLAIN" . script("qsl('a').onclick = partial(toggle, '$explain_id');", "");
+ }
$id = "export-$commands";
- $export = ", " . lang('Export') . "" . script("qsl('a').onclick = partial(toggle, '$id');", "") . ": "
+ echo ", " . lang('Export') . "" . script("qsl('a').onclick = partial(toggle, '$id');", "") . ": "
. html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
. html_select("format", $dump_format, $adminer_export["format"])
. ""
. " \n"
+ . "\n"
;
- if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
- $id = "explain-$commands";
- echo ", EXPLAIN" . script("qsl('a').onclick = partial(toggle, '$id');", "") . $export;
- echo "