Aleksandrs Posted February 25, 2005 Report Posted February 25, 2005 Kā no konkrētas datubāzes izskaitļot, katras tabulas nosakumu un to pēc tam optimizēt?
Aleksandrs Posted February 25, 2005 Author Report Posted February 25, 2005 (edited) Padomāju, sanāca šāds kods: <? ini_set('max_execution_time', 0); $c_db = 'db'; $mysql = @mysql_connect('localhost', 'user', 'password'); if(!$mysql){ exit('Connect error!'); } $mysql = @mysql_select_db($c_db); if(!$mysql){ exit('Database error!'); } $query = 'SHOW TABLE STATUS FROM `'.$c_db.'`'; $results = mysql_query($query); while($row = @mysql_fetch_assoc($results)){ if($row['Data_free']>0){ mysql_query('OPTIMIZE TABLE `'.$row['Name'].'`'); } } ?> Es tikai nevaru saprast, vai pēc optimize ir jalieto flush tables? Edited February 25, 2005 by Aleksandrs
Recommended Posts