<?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   = "test";
		
	}
	
	else {
  	       //$db_host    = "sql2";
   	       //$db_user   = "analogde";
 	       //$db_pass   = "rainbow";
	       //$db_name   = "analogde";
		   $db_host    = "analogdepat.mysql.db";
   	       $db_user   = "analogdepat";
 	       $db_pass   = "Un92pac007";
	       $db_name   = "analogdepat";
		   
		   //echo "Hébergeur OVH";
		   
		   //$db_host    = "bonneansoudb.mysql.db";
   	       //$db_user   = "bonneansoudb";
 	       //$db_pass   = "Un92pac007";
	       //$db_name   = "bonneansoudb";
		   
		   
		   //analogdepdl
//analogdepat.mysql.db	
		  
		 }
	
		$connexion = mysqli_connect($db_host,$db_user,$db_pass); 
		if(!$connexion)
		{
			die('Could not connect: ' . mysql_error());
		}
 
		mysqli_select_db($connexion, $db_name); 
		
		
}
//https://phpmyadmin.ovh.net/old  sql2  300gp
?>