include("../function/sessioncheck.php");
include("../function/connectdb.php");
include("../function/valuecheck.php");
include("../function/userdatacheck.php");
include("../function/config.php");
echo "已完成優化資料庫資料表之作業 ...
"; $alltables = mysqli_query($link,"SHOW TABLES;"); // record the output $output = array(); while($table = mysqli_fetch_assoc($alltables)){ foreach($table as $db => $tablename){ $sql = 'OPTIMIZE TABLE '.$tablename.';'; $response = mysqli_query($link,$sql) or die(mysql_error()); $output[] = mysqli_fetch_assoc($response); }; }; // print output echo "
"; $alltables = mysqli_query($link,"SHOW TABLES;"); // record the output $output = array(); while($table = mysqli_fetch_assoc($alltables)){ foreach($table as $db => $tablename){ $sql = 'OPTIMIZE TABLE '.$tablename.';'; $response = mysqli_query($link,$sql) or die(mysql_error()); $output[] = mysqli_fetch_assoc($response); }; }; // print output echo "
".print_r($output,true).""; ?>