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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.