Пример #1
0
     }
 } elseif (is_object($result)) {
     $limit = $_POST["limit"];
     $orgtables = adminer_select($result, $connection2, array(), $limit);
     if (!$_POST["only_errors"]) {
         echo "<form action='' method='post'>\n";
         $num_rows = $result->num_rows;
         echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
         echo $time;
         $id = "export-{$commands}";
         $export = ", <a href='#{$id}' onclick=\"return !toggle('{$id}');\">" . lang('Export') . "</a><span id='{$id}' class='hidden'>: " . html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " " . html_select("format", $dump_format, $adminer_export["format"]) . "<input type='hidden' name='query' value='" . h($q) . "'>" . " <input type='submit' name='export' value='" . lang('Export') . "'><input type='hidden' name='token' value='{$token}'></span>\n";
         if ($connection2 && preg_match("~^({$space}|\\()*SELECT\\b~isU", $q) && ($explain = explain($connection2, $q))) {
             $id = "explain-{$commands}";
             echo ", <a href='#{$id}' onclick=\"return !toggle('{$id}');\">EXPLAIN</a>{$export}";
             echo "<div id='{$id}' class='hidden'>\n";
             adminer_select($explain, $connection2, $orgtables);
             echo "</div>\n";
         } else {
             echo $export;
         }
         echo "</form>\n";
     }
 } else {
     if (preg_match("~^{$space}*(CREATE|DROP|ALTER){$space}+(DATABASE|SCHEMA)\\b~isU", $q)) {
         restart_session();
         set_session("dbs", null);
         // clear cache
         stop_session();
     }
     if (!$_POST["only_errors"]) {
         echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "{$time}\n";
Пример #2
0
        echo "<p class='error'>" . error() . "\n";
    } else {
        $connection2 = connect();
        if (is_object($connection2)) {
            $connection2->select_db(DB);
        }
        do {
            $result = $connection->store_result();
            if (is_object($result)) {
                adminer_select($result, $connection2);
            } else {
                echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $connection->affected_rows) . "\n";
            }
        } while ($connection->next_result());
        if ($out) {
            adminer_select($connection->query("SELECT " . implode(", ", $out)));
        }
    }
}
?>

<form action="" method="post">
<?php 
if ($in) {
    echo "<table cellspacing='0'>\n";
    foreach ($in as $key) {
        $field = $routine["fields"][$key];
        $name = $field["field"];
        echo "<tr><th>" . $adminer->fieldName($field);
        $value = $_POST["fields"][$name];
        if ($value != "") {