📜  php mysqli 连接两个数据库 pdo - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:14.775000             🧑  作者: Mango

代码示例1
$conn1 = new PDO("mysql:host=$hostname;dbname=database1", $username, $password);
$conn2 = new PDO("mysql:host=$hostname;dbname=database1", $username, $password);

$conn1->query("SELECT * FROM table");
$conn1->query("SELECT * FROM table");