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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.