Jump to content

Connect Problem


f6100153

Recommended Posts

Hi,

 

Im using the following code to connect to database, which is hosted by 1and1.

 

$con = mysql_connect("host.oneandone.co.uk","username","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("database", $con);

 

The code works fine when I use it on the website hosted by 1and1 but I am also trying to get a locally hosted website to connect to it and its giving the following error.

 

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'host.oneandone.co.uk' (11004) in C:\Site\Engine.php on line 71

Could not connect:

 

The local server can connect to a local database using the same code.

Link to comment
https://forums.phpfreaks.com/topic/222206-connect-problem/
Share on other sites

You will need to have a static ip to make it work.

On the client backend, look for Remote Database Access Hosts then insert your static ip.

if Remote Database Access Hosts is not there, contact the tech support and ask them to ass your ip to the Remote Database Access Hosts

 

Link to comment
https://forums.phpfreaks.com/topic/222206-connect-problem/#findComment-1149936
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.