PHP - Optimize database table … Easy trick

42 views

How to optimize PHP database table… Here code goes:

  1.  dbConnect()
  2. $alltables = mysql_query(”SHOW TABLES”);
  3.  
  4. while ($table = mysql_fetch_assoc($alltables))
  5. {
  6. foreach ($table as $db => $tablename)
  7. {
  8. mysql_query(”OPTIMIZE TABLE ‘”.$tablename.”‘”)
  9. }
  10. }



« PHP - make webpage password protected PHP - Send an alert email »
Posted on Monday, March 9th, 2009 at 10:54 am under PHP Tricks | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?