I have written a query in PhpMyadmin to fetch data from two databases running in the same server, and is working fine. But I am not sure how to use this query in PHP code. This query contains RIGHT JOIN and other sub-queries. Even if I open two DB connections, how will I execute this query and which Connection should I use?
Eg.
Database A: Table: accountmaster (contains the profile details of the users, with IDs for City, State etc) Database B: All masters (City, State etc)
Query: fetching all profile entries by joining these two databases.