经测试代码如下:
<?PHP
/**
* 优化表
*
* @param
* @arrange (512.笔记) jb51.cc
**/
dbConnect(); // Database connection
$alltables = MysqL_query("SHOW TABLES");
while ($table = MysqL_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename){
MysqL_query("OPTIMIZE TABLE '".$tablename."'")
or die(MysqL_error());
}
}
原文链接:https://www.f2er.com/php/528823.html