Two databases? Should be able to.
Within the same query? No.
The two databases would have to be:
$conn1 = mysql_connect('localhost', 'username', 'password');
mysql_select_db('database1', $conn1);
$conn2 = mysql_connect('localhost', 'username', 'password');
mysql_select_db('database2', $conn2);
Now, from there with each mysql_query() call you'd have to deliniate which connection you want to use.
Two tables is a different story. THen it's just two different queries, which you can do anyway....