Before things get too far afield, are you sure you have 2 databases and not 2 tables in a single database?
Do you have 2 separate usernames, 2 separate passwords, 2 separate logins, etc? That means 2 databases.
If you have 1 login, but you're storing data in 2 data areas, those data-thingies are called 'tables', and your problem is simpler.