Connection code to the database is ;
Code: Select all
$db = mysql_connect("127.0.0.1:8889","root", "root");
if (!$db){
echo "Could not connect to database";
exit();
}
$db_name = "SPP Local";
if (!mysql_select_db($db_name, $db)){
die ("Could not select database." . mysql_error());
}
Code: Select all
$json = '{ "class": "go.GraphLinksModel",
"nodeDataArray": ' .$json .',
"linkDataArray": [
{"from":"Products", "to":"Categories"},
{"from":"Products", "to":"Suppliers"},
{"from":"Order Details", "to":"Products"}
]}';
echo $json ;
{ "class": "go.GraphLinksModel",
"nodeDataArray": [],
"linkDataArray": [
{"from":"Products", "to":"Categories"},
{"from":"Products", "to":"Suppliers"},
{"from":"Order Details", "to":"Products"}
]}
Which means my query isn't returning anything... I've ran the query within the MAMP page and directly on the server and it works fine, I just can't connect to the server remotely and use the results from the query. Anyone have any ideas? My php is limited and it's not my favourite language, by far