//first - your development server
if ($_SERVER['HTTP_HOST'] == "127.0.0.1")
{
$hostname_content = "localhost";
$database_content = "YOUR_DATABASE";
$username_content = "YOUR_USER";
$password_content = "YOUR_PASS";
$conn = mysql_pconnect($hostname_content, $username_content, $password_content) or trigger_error(mysql_error(),E_USER_ERROR);
}
//second- your production server
else
{
$hostname_content = "YOUR_PRODUTION_SERVER";
$database_content = "YOUR_PRODUCTION_DATABASE";
$username_content = "YOUR_PRODUCTION_USER";
$password_content = "YOUR_PRODUCTION_PASS";
$conn = mysql_pconnect($hostname_content, $username_content, $password_content) or trigger_error(mysql_error(),E_USER_ERROR);
}
?>
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/pYhxkJaY3mY/11925