./$dbName.$date.sql"); mysql_select_db($dbName); $result=mysql_query('show tables'); while($tables = mysql_fetch_array($result)) { foreach ($tables as $key => $value) { mysql_query("ALTER TABLE $value COLLATE $collation"); } } } ?> The collation of your database has been successfully changed!