At the end of a daily cron job, a php script runs the code below to optimize all tables in a database. The script produces no errors, but seems to fail at optimizing the tables; I have noticed that the overhead size of my tables has been increasing.

PHP Code:
//OPTIMIZE TABLES
$all_tables mysql_query("SHOW TABLES") or die(mysql_error());
$current_table mysql_fetch_assoc($all_tables);
do {
    
mysql_query("OPTIMIZE TABLE $current_table") or die(mysql_error());
} while (
$current_table mysql_fetch_assoc($all_tables)); 

Anyone have any ideas?