Jump to content

[SOLVED] Quick question about database connection


adamjones

Recommended Posts

Hi.

 

Just wondering how I would go around connecting to a database on a different server?

 

<?php

$host="localhost";
$username="username";
$password="password";
$db_name="database";

?>

 

Would I just change it to;

 

<?php

$host="mywebaddress.com";
$username="username";
$password="password";
$db_name="database";

?>

 

Or is it more complex? Sorry about the silly question!

 

 

Does this work if you're using shared hosting? Just tried and got this error;

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'wowdream_domaine'@'atlantic.lc-hosting.com' (using password: YES) in /home/visionop/public_html/test.php on line 8

cannot connect

 

 

...Must I have dedicated hosting?

 

Regards.

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.