Page 1 of 1

access remote database

Posted: Mon Oct 03, 2011 9:48 am
by shankari
Hi,

I have hosted my website. I had only html files. But now I want to create a form in php. But I cannot access database as per the plan that I bought.
Instead I have a friend who says I can use access her database and she has given all the permissions.

This php file is in server A and the database test_db is in server B.
<?php



$user_name = "aaaa";
$password = "bbbbb";
$database = "test_db";
$server = "xxxxxxxxx";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
?>
When I try to run this php file, I get this error



Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@sds.xxx.in and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache mod_fcgid/2.3.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at sds.xxx.in Port 80


Pl help me.


Shankari

Re: access remote database

Posted: Mon Oct 03, 2011 6:03 pm
by Christopher
That is a HTTP error message. Are you adding http:// to the server name? It should just me the domain name or IP address.

Re: access remote database

Posted: Mon Oct 03, 2011 11:20 pm
by shankari
This is the URL,


domainname.in/test.php

Re: access remote database

Posted: Tue Oct 04, 2011 12:55 am
by Christopher
It should just be domainname.in or the IP address. You connect to the MySQL server on port 3306, not via the web server.