Updating settings.php prior to BETA or LIVE

In settings.php a change is needed to allow Drupal to access the Live database vs the Local Database.

The original entry will look like this

<?php
 $databases
= array (
 
'default' =>
  array (
   
'default' =>
    array (
     
'database' => 'dbname',
     
'username' => 'username',
     
'password' => 'zZx9-ggg',
     
'host' => 'localhost',
     
'port' => '',
     
'driver' => 'mysql',
     
'prefix' => '',
    ),
  ),
);
?>

You will need to change it to look like

<?php
$hostname
= (strstr($_SERVER['SERVER_NAME'], "mydevserver.com") ? "localhost" : "livedbserver"); // <-- This was added
 
$databases = array (
 
'default' =>
  array (
   
'default' =>
    array (
     
'database' => 'dbname',
     
'username' => 'username',
     
'password' => 'zZx9-ggg',
     
'host' => $hostname// <--this was changed
     
'port' => '',
     
'driver' => 'mysql',
     
'prefix' => '',
    ),
  ),
);
?>

livedbserver is the live db host in this particular case. That will need to be adjusted to match your site accordingly.

section: