Mutley Posted April 22, 2008 Share Posted April 22, 2008 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. Link to comment https://forums.phpfreaks.com/topic/102372-connecting-to-remote-sql-server-with-php/ Share on other sites More sharing options...
iarp Posted April 22, 2008 Share Posted April 22, 2008 Alot of hosts only allow sql connections from within their own network for security reasons. Other then that, you'd have to contact tech support for the info because if your using a shared server it's network address won't be myothersite.com Link to comment https://forums.phpfreaks.com/topic/102372-connecting-to-remote-sql-server-with-php/#findComment-524200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.