It actually executes "USE database", or that is what PHP does in other DBMS libs. Take a look in the source, that is why it is provided to you!
In any rate, if you are already connected in a database no need to change contexts; simply use the database.tablename convention in your query:
SELECT *
FROM other_database.table