<?php
if($connected=@fsockopen('www.google.com',80)){
$dbhost1 = "192.168.43.94";
$dbuser1 = "root";
$dbpassword1 = "";
$db1 = "product";
$connection1 = mysqli_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysqli_error());
mysqli_select_db($connection1,$db1);
//MySQL Server 2
$dbhost2 = "localhost";
$dbuser2 = "root";
$dbpassword2 = "";
$db2 = "product";
$connection2 = mysqli_connect($dbhost2,$dbuser2,$dbpassword2) or die (mysqli_error());
mysqli_select_db($connection2,$db2);
$sql="insert into 192.168.43.94.product.dbo.inserting select * from OPENQUERY(localhost,'select * from product.dbo.inserting')";
$my=mysqli_query($connection2,$sql);
if(!$my){
echo 'Query failed'.mysqli_error();
}
}
?>
我通过使用openquery语句(tcl)但它无法正常工作
我使用的是链接服务器。两种服务器是相同类型的服务器,具有相同的表结构