Пример #1
0
    } elseif ($_POST["move"]) {
        $result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
        $message = lang('Tables have been moved.');
    } elseif ($_POST["copy"]) {
        $result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
        $message = lang('Tables have been copied.');
    } elseif ($_POST["drop"]) {
        if ($_POST["views"]) {
            $result = drop_views($_POST["views"]);
        }
        if ($result && $_POST["tables"]) {
            $result = drop_tables($_POST["tables"]);
        }
        $message = lang('Tables have been dropped.');
    } elseif ($jush != "sql") {
        $result = $jush == "sqlite" ? queries("VACUUM") : apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"]);
        $message = lang('Tables have been optimized.');
    } elseif (!$_POST["tables"]) {
        $message = lang('No tables.');
    } elseif ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))) {
        while ($row = $result->fetch_assoc()) {
            $message .= "<b>" . h($row["Table"]) . "</b>: " . h($row["Msg_text"]) . "<br>";
        }
    }
    queries_redirect(substr(ME, 0, -1), $message, $result);
}
page_header($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"]), $error, true);
if ($adminer->homepage()) {
    if ($_GET["ns"] !== "") {
        echo "<h3 id='tables-views'>" . lang('Tables and views') . "</h3>\n";
        $tables_list = tables_list();
Пример #2
0
 /** Run commands to truncate tables
  * @param array
  * @return bool
  */
 function truncate_tables($tables)
 {
     return apply_queries("TRUNCATE TABLE", $tables);
 }