Jump to content

mysqli connect file works when uploaded but not local any ideas


fortnox007

Recommended Posts

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?

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.