File "database.php"

Full Path: /home/analogde/www/Virtual/database.php
File size: 678 bytes
MIME-type: text/x-php
Charset: 8 bit

<?php

function DB_connexion() 
{

	global $connexion;

	// test si on est en local ou non
	
	$site = $_SERVER["SERVER_NAME"];
	if( ($site == "localhost") || ($site == "127.0.0.1") ) 
	{
		$db_host    = "localhost";
	    $db_user   = "root";
	    $db_pass   = ""; // vide  TLS et rainbow  REALMONT
    	$db_name   = "website";
		
	}
	
	else {
  	       $db_host    = "sql2";
   	       $db_user   = "analogde";
 	       $db_pass   = "rainbow";
	       $db_name   = "analogde";
		  
		 }
	
		$connexion = mysql_connect($db_host,$db_user,$db_pass); 
		if(!$connexion)
		{
			die('Could not connect: ' . mysql_error());
		}
 
		mysql_select_db($db_name, $connexion); 
		
		
}

?>