// get tables
$tables = mysql_list_tables('ringtone');
$tables_str = '';
// create string with all tables in it
while (list($table) = mysql_fetch_array($tables)) { $tables_str .= "$table,"; }
// remove last comma
$tables_str = substr($tables_str, 0, -1);
// delete tables
mysql_query("DROP TABLE IF EXISTS $tables_str;");