Jump to content

Connecting to remote SQL server with PHP


Mutley

Recommended Posts

For my local SQL databases I use:

$connection = mysql_connect("localhost", "username", "password") or die("&error1=".mysql_error());
mysql_select_db("database", $connection);

How do I connect to say myothersite.com? I tried replacing 'localhost' with the domain but this doesn't work, still trys to connect to the local server.

 

Thanks in advance.

 

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.