Cross-database join queries, expanding on Dan Ross's post...
Really, this is a mysql specific feature, but worth noting here. So long as the mysql user has been given the right permissions to all databases and tables where data is pulled from or pushed to, this will work. Though the mysql_select_db function selects one database, the mysql statement may reference another (the syntax for referencing a field in another db table being 'database.table.field').
$sql_statement = "SELECT
LEFT JOIN Users.tblUsers ON AuthorID = Users.tblUsers.UserID
GROUP BY PostID,AuthorID,Username
$dblink = mysql_connect("somehost", "someuser", "password");
$qry = mysql_query($sql_statement,$dblink);