How Can I use this 2 connections to run a query which joins 2 tables?
yesno.table1 and sushi.table1 ? lets say we join by id they both have the same id.
how can
This is possible but not in the way you're attempting it.
First, you will need to have a mysql user with permissions to access both databases.
Then you simply reference the secondary database as part of the query.
E.g.
// Connect to Database -- dbuser has permissions for database1 and database2
$this->db = new mysqli("localhost", "dbuser", "***", "database1");
$query = "SELECT t1.*, t2.*
FROM table_one AS t1
INNER JOIN database2.table_two as t2 ON ( t1.id = t2.remote_id ) ";
This isn't possible if the databases are on two different servers.