Hello,
I was wondering how I go about choosing the database based on host.
So I might have something like:
switch ($_SERVER['HTTP_HOST'])
{
case 'mysite.com':
{
$db_name = 'mysite';
$db_pass = 'mysite';
$db_user = 'mysite';
break;
}
case 'localhost':
{
$db_name = 'localdb';
$db_pass = 'localpass';
$db_user = 'localuser';
break;
}
}
That way when I make any changes to the config files and upload to the development server I don’t have to manually edit the file to make it work.
Thanks!