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."