fortnox007 Posted January 20, 2011 Share Posted January 20, 2011 Hi all I was trying to connect to a database which is running on an external host. So i thought i try the stuff below. That didn't work. Is it possible that the host has disabled external connection or something? I tried to add http:// before the domain, but no succes either <?php $dbc = mysqli_connect('db87654321.somedomain.com','user','pass','database')// this is line 5 or die(mysqli_error($dbc)); echo 'connected'; ?> it gave the following error: Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'db87654321.somedomain.com' (11004) in H:\xampp\htdocs\databasetestfile.php on line 5 P.s. the script worked when upload to the server. P.p.s is there something i should be carefull with when connection to an external database? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 20, 2011 Share Posted January 20, 2011 It's actually very likely that the host has disallowed external connections. Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted January 20, 2011 Author Share Posted January 20, 2011 Ok that's good to know, Ill ask them when they are awake. May i assume that it would be insecure to use an external database? Or are there any drawbacks? Quote Link to comment 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.