access remote database
Posted: Mon Oct 03, 2011 9:48 am
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
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