具體的實(shí)現(xiàn)方法如下:
ysqlinect("localhost", "user1", "password1", "database1");ysqlinect("localhost", "user2", "password2", "database2");
ysqli_query()函數(shù)來執(zhí)行SQL語句,比如:
$sql = "SELECT * FROM table1";ysqli_query($db1, $sql);
3. 最后,我們需要將查詢的結(jié)果存入另一個(gè)數(shù)據(jù)庫中,比如:
n1n2) VALUES ('value1', 'value2')";ysqli_query($db2, $sql);