I do this with a switch statement that goes off the server name..
switch ($_SERVER['SERVER_NAME']) {
case "www.ooer.com":
define("DATABASE_HOST","localhost");
define("DATABASE_USER","ooeruser");
define("DATABASE_PASSWORD","password");
define("PRIMARY_DATABASE_NAME","ooer");
break;
case "localhost":
define("DATABASE_HOST","localhost");
define("DATABASE_USER","root");
define("DATABASE_PASSWORD","password");
define("PRIMARY_DATABASE_NAME","ooer");
break;
}
Then, in my connection I use:
$databaseLink = mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD);
mysql_select_db(PRIMARY_DATABASE_NAME, $databaseLink);
To find out your $SERVER['SERVER_NAME'] for the online version just make a page that does "echo $SERVER['SERVER_NAME'];".. this way you can have a case for every place the website may go. In my case thats my local development machine, the office test server, a laptop demo machine, an online test server, and the online live server.. :queasy: