DB Connectivity
Posted: Sun Apr 03, 2005 9:58 pm
php newbie here.
I have 2 sites hosted on the same server. For simplicity, let's just say that I have abc.com and xyz.com.
I have a script that runs on xyz.com and utilizes config.php. This script does hit a database on xyz.com. There is more than one database on xyz.com.
The db is large, and I see no reason to duplicate on abc.com. I would like to move the script from xyz.com to abc.com. However, the config.php on abc.com will obviously override the db connectivity. I tried just inserting the following code in the script on abc.com (and removed the reference to config.php):
$dbms = 'mysql';
$dbhost = 'localhost';
$dbname = 'xyz_com_-_db2';
$dbuser = 'user';
$dbpasswd = 'password';
However, that doesn't seem to work. Should it? Do I have to change $dbhost? If so, to what?
Thanks.
I have 2 sites hosted on the same server. For simplicity, let's just say that I have abc.com and xyz.com.
I have a script that runs on xyz.com and utilizes config.php. This script does hit a database on xyz.com. There is more than one database on xyz.com.
The db is large, and I see no reason to duplicate on abc.com. I would like to move the script from xyz.com to abc.com. However, the config.php on abc.com will obviously override the db connectivity. I tried just inserting the following code in the script on abc.com (and removed the reference to config.php):
$dbms = 'mysql';
$dbhost = 'localhost';
$dbname = 'xyz_com_-_db2';
$dbuser = 'user';
$dbpasswd = 'password';
However, that doesn't seem to work. Should it? Do I have to change $dbhost? If so, to what?
Thanks.