<?php

			error_reporting(0);
			date_default_timezone_set('Europe/Paris');

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   = "projet";
				
			}
	
			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); 
		
}

?>