$query) { $pdo->queryExec(sprintf('DROP TABLE IF EXISTS %s', $table)); $pdo->queryExec($query); } echo 'All done! If you messed up your sphinx connection info, you can rerun this script.'.PHP_EOL;