连接到2个或更多数据库,并从同一主机中这些数据库中的表中进行选择

Connect to 2 or more databases and select from tables in those databases.

I never needed this before, but now...i really do need! :)

I've googled but i could not find the right answer.

I need to connect to 2 or more database and then, if i need to, i want to select info from tables that are in one or more databases, using JOIN for example.

I have a user that has access to all databases and databases are all in the same host. I'm using mysqli.

How do i do this?

Thank you very much.

SELECT * from db1.table ...
LEFT JOIN db2.table ON ...