Link to home
Start Free TrialLog in
Avatar of Rajesh Joshi
Rajesh JoshiFlag for India

asked on

mysql database connectivity from remote server.

mysql database is on Godaddy.
I want to connect it from remote website.
I tried with following code, but the message is
This page isn’t working
fhiaportal.com is currently unable to handle this request.
HTTP ERROR 500
my connection file is as below.
$user = "xxmyusername";  // actual details are hidden
 $pass = "xxmypassword";
 $db = "xxdatabasename";
 $host = "50.62.209.149";
  $mysqli = mysqli_connect($host,$user, $pass, $db);
$conn = new mysqli($host, $user, $pass, $db);

Open in new window

Avatar of Ares Kurklu
Ares Kurklu
Flag of Australia image

is mysql enabled in php?
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Quoting Chris for emphasis...
Also, you will need to make sure your GoDaddy DB is setup to allow Direct Database Access - their docs say you need to do this when setting it up as it can't be enabled later.  
Avatar of skullnobrains
skullnobrains

if you get an error 500, either your script sends it voluntarily ( which is apparently not the case ) of your script was not called at all because of a misconfiguration of the web server. do not bother changing the script before you solve this error. rather have a look at your web server error log