« MAC bittorrent clients review | Isometric excercises for throat part of the spine »
one php config file for multiple web servers
By pavic | April 20, 2007
This is a way I am using for years, to speed up developement.
if($_SERVER[’SERVER_NAME’]==’www.acosonic.com’) {
$dbHostname = “localhost”;
$dbUsername = “aleksaho”;
$dbPassword = “fED7LzMA”;
$dbName = “aleksaho”;
} else if($_SERVER[’SERVER_NAME’]==’www.fsdff.com’)
{
$dbHostname = “localhost”;
$dbUsername = “root”;
$dbPassword = “”;
$dbName = “hotel_aleksandar”;
} else {
$dbHostname = “localhost”;
$dbUsername = “root”;
$dbPassword = “”;
$dbName = “hotel_aleksandar”;
}
// Make connection to database
// If no connection made, display error Message
$dblink = MYSQL_CONNECT($dbHostname, $dbUsername, $dbPassword) OR DIE(”Error !! Unable to connect to database”);
// Select the database name to be used or else print error message if unsuccessful*/
@mysql_select_db($dbName) or die( “Unable to select database “.$dbName);
Topics: PHP |
Comments
You must be logged in to post a comment.
« MAC bittorrent clients review | Isometric excercises for throat part of the spine »
one php config file for multiple web servers
By pavic | April 20, 2007
This is a way I am using for years, to speed up developement.
if($_SERVER[’SERVER_NAME’]==’www.acosonic.com’) {
$dbHostname = “localhost”;
$dbUsername = “aleksaho”;
$dbPassword = “fED7LzMA”;
$dbName = “aleksaho”;
} else if($_SERVER[’SERVER_NAME’]==’www.fsdff.com’)
{
$dbHostname = “localhost”;
$dbUsername = “root”;
$dbPassword = “”;
$dbName = “hotel_aleksandar”;
} else {
$dbHostname = “localhost”;
$dbUsername = “root”;
$dbPassword = “”;
$dbName = “hotel_aleksandar”;
}
// Make connection to database
// If no connection made, display error Message
$dblink = MYSQL_CONNECT($dbHostname, $dbUsername, $dbPassword) OR DIE(”Error !! Unable to connect to database”);
// Select the database name to be used or else print error message if unsuccessful*/
@mysql_select_db($dbName) or die( “Unable to select database “.$dbName);
Topics: PHP |
Comments
You must be logged in to post a comment.
