Forum Moderators: coopster
To cut short I have a website I have had in operation for many years but tied down to a contract I can not change. I want to add the functionality of a MySQL database, but they do not support this.
I have other websites on different hosts that do have spare MySQL databases and was wondering whether I can cross-link?
Hope this makes sense?
D
However if you're still determined here's what you do:
On nodb.server.com write you script
on mysql.server.com write a script to process a db and echo info.
You can call a script on mysql.server.com with include. But remember - it will only echo things, no variables returned!
So nodb: include("mysql.server.com/update.php?id=2&money=200&user=root");
And on mysql.../update.php you will have:
<?php
if(!($id = (int)$_GET["id"])) die("Wrong id");
$money = (int)$_GET["money"];
if(ctype_alnum($_GET["user"]) $user = $_GET["user"];
else die("Username must be only alphanumeric");$sql = "UPDATE table SET money='money' WHERE id='$id' AND user='$user'"
mysql_query($sql) or die("Error: ".mysql_error());
echo "The amount of money was submitted";?>