예제 #1
0
 $result = true;
 $message = "";
 if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) {
     queries("SET foreign_key_checks = 0");
     // allows to truncate or drop several tables at once
 }
 if ($_POST["truncate"]) {
     if ($_POST["tables"]) {
         $result = truncate_tables($_POST["tables"]);
     }
     $message = lang('Tables have been truncated.');
 } 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"])))) {
예제 #2
0
	$num_tables = mysql_num_rows($tableslist);
	for ($i=0; $i < $num_tables; $i++) {
		$row = mysql_fetch_array($tableslist);
		array_push($tablesarray, $row[0]);
	}
	mysql_free_result($tableslist);
	return $tablesarray;
}



$s = "mysql.solostyle.net";
$u = "solostyle";
$p = 'qas??wed';
$db = "iam";

select_db($s, $u, $p, $db);

$year = $_POST['year'];
print $year;
print $_POST['func'];
if ($_POST['func'] == "copy") 
	copy_tables($year);
if ($_POST['func'] == "drop")
	drop_tables($year);

mysql_close();

?>