I just tried a query like this in phpMyAdmin and it seemed to work just fine:
SELECT t1.*, t2.* FROM db1.some_table t1, db2.some_table t2 WHERE t2.field1=t1.field2
I am guessing this means I'll be able to write queries that join tables from two separate dbs in my code using the mysql_* functions. Is that so?
If so, I'm sort of wondering mysql_select_db is really just a matter of convenience -- kind of like the working directory concept in linux. You don't have to type in the database name for every table because the current db is assumed. Do I have that right?
I'm also assuming that if I connect to a db as userX, then in any query, I can reference any table in any db for which userX has the right permissions. Is that correct?