$query) { DB::statement("DROP TABLE IF EXISTS $table;"); DB::statement($query); } $tableSQL_predb = <<<'DDLSQL' CREATE TABLE predb_se ( id BIGINT UNSIGNED NOT NULL, weight INTEGER NOT NULL, query VARCHAR(1024) NOT NULL, title VARCHAR(255) NOT NULL DEFAULT '', filename VARCHAR(1000) NULL, INDEX(query) ) ENGINE=SPHINX CONNECTION="%spredb_rt" DDLSQL; $tables2 = []; $tables2['predb_se'] = sprintf($tableSQL_predb, $sphinxConnection); foreach ($tables2 as $table => $query) { DB::statement("DROP TABLE IF EXISTS $table;"); DB::statement($query); } echo 'All done! If you messed up your sphinx connection info, you can rerun this script.'.PHP_EOL;