同时使用localhost和server localhost

时间:2013-12-01 04:50:27

标签: php mysql localhost wamp wampserver

我使用的是典型的php mysql脚本但它在服​​务器上造成了很大的负担所以想到使用我的个人电脑并安装了wamp所以现在我想从我的电脑localhost mysql中选择数据并将数据插入网站服务器localhost。那我怎么能这样做呢。

我只有一个简单的脚本,它从mysql中选择数据并在满足条件的情况下将数据插入到mysql中,但如何在脚本中为两个连接执行此操作。

select将使用mypc wamp localhost并且insert将使用server localhost .table名称可以相同。这是我的代码

     <?php
           include('connect.php'); 
           $query = mysql_query("SELECT * FROM `tablea` where status = '1' order by id asc LIMIT 5");
           // tableA is in my personal PC localhost   
           while ($result = mysql_fetch_array($query)) {
             //  Do Something    
            mysql_query ("INSERT INTO tableb (title,content,url) VALUES ('$title1','$content','$url')");
             // tableB is in my website localhost

         } 
           mysql_query("update tablea set status='2' where type='$type' ");
           //my personal pc localhost
     }
  ?>

0 个答案:

没有答案
相关问题