I think I had a similar issue. Take a peek here:
http://wordpress.org/support/topic/90340
Thread Starter
4mica
(@4mica)
Thanks for getting back to me. What I ended up doing was just reestablishing the connection to the wordpress database on pages that had multiple databases, just by using:
mysql_connect($server,$loginsql,$passsql);
@mysql_select_db($base) or die( “Unable to select database”);
I’m using the non WP database on many more pages than the wordpress database and it was less to change.