7 Replies Latest reply on Aug 15, 2010 10:41 PM by kglad

    Update two at the same time...

    Ron Colmen Level 2

      How can I update two mysql databases (on two servers) at the same time. DO I need to give permission to send data?


      E.g. The swf is in server A and I want to post data to 2 databases in server A and server B. But when I do it only updates in server A. Nothing goes to server B. How can I do this? Is this got to do with php? Please advice.



      //SERVER A

      $link = mysql_connect("localhost","abc","abc1");



      $query = "INSERT INTO abc_db(subject, links) VALUES('$hsubjects','$link')";

      $result = mysql_query($query);


      //SERVER B

      $links = mysql_connect("xxx.xxx.xx.xxx","xyz","xyz1");



      $query = "INSERT INTO notice_db(subject, links) VALUES('$hsubjects','$link')";

      $result = mysql_query($query);


      $sentOk = "The data has been added to the database.";

      echo "sentOk=" . $sentOk;