PHP – Optimize database table … Easy trick

How to optimize PHP database table... Here code goes:

  dbConnect()
$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()); } }

Post Comment
Login to post comments