为什么无法建立连接!!如何在单独的服务器上的两个数据库中的两个表之间创建关系以获取信息 实际上,我想从第二台服务器的表中获取记录并插入表中的另一台服务器 表选择是正确的:site1.com.class.users
这是我的代码:
$conn_server1=mysql_connect("site1.com","user","pass");
$db_server1=mysql_select_db("class",$conn_server1);
$conn_server2=mysql_connect("site2.com","user","pass");
$db_server2=mysql_select_db("class",$conn_server2);
$result=mysql_query("select * from site2.com.class.users where site2.com.class.users.mobile not in(select mobile form site1.com.class.users)",$conn_server1);
while(mysql_fetch_assoc($result))
mysql_query("insert into site1.com.class.users(name,family,phone1,phone2,mobile) select name,family,phone1,phone2,mobile from
site2.com.class.users",$conn_server1);
site2.com.class.users",$conn_server1);