Results 1 to 4 of 4

Thread: how to send the datebase value from one server to other server

  1. #1
    Join Date
    Apr 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to send the datebase value from one server to other server

    Hi all ,

    I have one form, using this form, i am sending the data to one database server.
    After sending the data, i want to send the information to other server(second server). how to do can anybody will help.

    Thanks and regards

    Ranjan

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Do you mean you want to send to 2 different database servers, or do you want to send to one database server and then some script on a different server? If the first, simply make 2 sepearte sql connections (one after the other) and send the query like that. An example (using MySQL):

    Code:
    <?php
    
    //open the connection to 2 database servers
    $conn = mysql_connect("server1.host.com", 'username', 'password');
    $connection = mysql_connect("server2.host.com', 'username', 'password');
    
    //select the databases
    mysql_select_db('db1', $conn);
    mysql_select_db('db2', $connection);
    
    //execute the query
    mysql_query("INSERT INTO `table` VALUES ('null','1234')", $conn);
    mysql_query("INSERT INTO `table2` VALUES ('null','1234')", $connection);
    
    //close the connection
    mysql_close($conn);
    mysql_close($connection);
    
    ?>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you mean from one server(www.example.com) to another(www.example2.com), then you'd have to talk to your host(s) about doing that, although i highly doubt they'll allow it, considering that would be a big security risk.

  4. #4
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    but he could redirect to www.example2.com from www.example1.com.
    in www.example2.com - insert data
    and goback www.example1.com - insert data
    ???

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •