I have a script that connects to MySQL database, executes a query and sends the result as json data as a response. However I keep getting "Connection refused" as a response when using the following PHP method in the script:
$conn = mysqli_connect( "mydomainname.com", "myusername", "mypassword", "mydatabasename" );
I tested everything locally with EasyPHP DevServer and now that it's ready for production I inserted all records on the database at freehostia and moved the script to my domain at freehostia, but it doesn't work...
I tried the IP address as the host parameter for mysqli_connect but nothing is returned, not even a "echo" method works with that... What am I doing wrong, isn't the host my domain name ? I know that the username and database name are the same and correct, and I am sure that the password is correct, so that only leaves the host parameter as wrong only if I should not use my domain name...
Any help would be welcome
Thanks
|