I have a request that I should do the joint of 2 tables, 2 tables belong to different databases, how to prepare, execute and display the results, knowing that the first connection is $db1 and 2nd is $db, and preparation is made for example,here is my code:
$db=new PDO('mysql:host=localhost;dbname=service','root','');
$db1=new PDO('mysql:host=localhost;dbname=service1','root','');
$query = 'SELECT * FROM db1.table1 JOIN db2.table2 ... WHERE ... id = ?';