Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Optimize

Optimize

Ratings: (0)|Views: 1 |Likes:
Published by profmustamar
Optimized, PHP, WordPress, Autoblog
Optimized, PHP, WordPress, Autoblog

More info:

Published by: profmustamar on May 25, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

09/10/2013

pdf

text

original

 
<?php/*Template Name: Optimize Table*/?><?php get_header(); ?><?php// Statement to select the databases$db_select = 'SHOW DATABASES'; // Query mySQL for the results$db_result = MYSQL_QUERY($db_select); // Loop through all the databasesWHILE ($db_row = MYSQL_FETCH_ARRAY($db_result)) { // Select currently looped database and continue only if successfulIF (MYSQL_SELECT_DB($db_row[0])) { // Echo database nameECHO "<br><b>";ECHO $db_row[0];ECHO "</b><br>"; // Statement to select the tables in the currently looped database$tbl_status = 'SHOW TABLE STATUS FROM ' . $db_row[0]; // Query mySQL for the results$tbl_result = MYSQL_QUERY($tbl_status); // Check to see if any tables exist within databaseIF(MYSQL_NUM_ROWS($tbl_result)) { // Loop through all the tablesWHILE ($tbl_row = MYSQL_FETCH_ARRAY($tbl_result)) { // Statement to optimize table$opt_table = 'OPTIMIZE TABLE ' . $tbl_row[0]; // Query mySQL to optimize currently looped table$opt_result = MYSQL_QUERY($opt_table); // Echo table nameECHO " <i>";ECHO $tbl_row[0];ECHO "</i><br>"; } // End table while loop} ELSE { // Alert that there are no tables within databaseECHO " <i>No Tables</i><br>"; } // End table exists if statement } // End database if statement } // End database while loop

Activity (2)

You've already reviewed this. Edit your review.
1 hundred reads
1 hundred reads

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->