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 I do that?
// Connect to Yesno Database
$this->yesno_db = new mysqli("red", "yesno", "***", "yesnotmp");
if ($this->yesno_db->connect_errno) {
throw new Exception('Connection failed: '.$this->yesno_db->connect_error);
}
// Connect to Sushi Database
$this->sushi_db = new mysqli("red", "sushi", "***", "sushi");
if ($this->sushi_db->connect_errno) {
throw new Exception('Connection failed: '.$this->sushi_db->connect_error);
}
See Question&Answers more detail:os