doulu8847 2015-12-15 22:54
浏览 29

使用AJAX复制数据库表

I know this isn't an optimal solution, but I couldn't figure out how to get replication working on our database servers so I've been told to try this option. My boss wants me to copy a table from one database server to another, but the destination has tables that it needs to keep and from what I read, setting it up as a slave will delete its existing tables. I only need to copy one table.

As a result, I'm trying to implement AJAX in order to do this. However, I don't really know where to start with this aside from a basic "hello world" script that uses AJAX, but even that doesn't work. This is what I have so far.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
        <script type="text/javascript">
            //Idea is to use this to get statusresponse to provide database data
            $(function(){
                $.get("http://URL here/response.php", function(data){
                    alert(data);
                });
            });         
        </script>
    </head>

    <body>

    <?php
        //Processing of data goes here
    ?>

    </body>
</html>

I'm referring to the above file as request.php. The other file, response.php, is set up like this.

<?php

echo "Hello world.";

?>

I'm lost and I'm not sure how to get this working. Additionally, if you can provide any help on getting replication working between two servers, I'd appreciate it. I received some assistance but little else was said aside from "look into replication."

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 BP神经网络控制倒立摆
    • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
    • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算