I have read here about switching the current wp database on the fly using
$wpdb->select('database_name');
Once done, I understand that i will have to issue the same statement to the original database.
Questions:
Right after changing the database, do i need to flush caches or similar stuff to get things working properly? Will I need to call again WP header?
Potential issues?
select()will switch the db :) That's used to select tables. Read the question you linked - you need to instantiate a new wpdb object, with the db name as one of the arguments... – One Trick Pony Jun 22 '11 at 10:15$wpdb->select()is used to switch to a different database on the same server. If your user doesn't have access, it won't work. It internally callsmysql_select_db()and passes in the database name. – EAMann♦ Jun 22 '11 at 20:26