Warning: mysql_connect(): Can't connect to MySQL server on 'xx.xx.xx.xx' (4) in /home/config.php on line 38
Of course xx.xx.xx.xx is my IP, took it out.
The CMS is hosted on .x10hosting.com, MySQL database is on my own computer.
Connecting to the SQL on localhost works fine but I can't get it to connect remotely. :\
Code:
<?php
if(basename($_SERVER["PHP_SELF"]) == "config.php"){
die("Error 404");
}
session_start();
// Database
$host['hostname'] = "xx.xx.xx.xx";
$host['user'] = "root";
$host['password'] = "";
$host['database'] = "v117";
$serverip = "xx.xx.xx.xx";
$loginport = "8484";
// Server
$servername = "Test";
$version = "117.2";
$exp = "50x";
$meso = "1000x";
$drop = "1000x";
$forums = "../forum";
// Do not touch
mysql_connect($host['hostname'],$host['user'],$host['password']) OR die("Can't connect to server");
mysql_select_db($host['database']) OR die("Cannot select DB");
function sql_injectionproof($sCode) {
if (function_exists("mysql_real_escape_string")) {
$sCode = mysql_real_escape_string($sCode);
} else {
$sCode = addslashes($sCode);
}
return $sCode;
}
?>
The CMS is hosted on .x10hosting.com, MySQL database is on my own computer.
Connecting to the SQL on localhost works fine but I can't get it to connect remotely. :\