<?php
$host = 'localhost';
$log = 'login';
$pass = 'PASSWORD';
$db = 'DBNAME';
mysql_connect($host,$log,$pass);
mysql_select_db($db);
$q = mysql_query("SHOW TABLES");
while ($table = mysql_fetch_array($q))
{
mysql_query("ALTER TABLE `".$table['Tables_in_'.$db]."` ENGINE = InnoDB");
}
?>