<?php

	session_start();
	include('config_inc.php'); 	
	
        if($_SESSION['database']=="local")
          {
             $db_host    = "localhost";
             $db_user   = "root";
     	     $db_pass   = "";
    	     $db_name   = "boutique";

  	  }
	
	if($_SESSION['database']=="public")
	  {
  	     $db_host    = "sql2";
   	     $db_user   = "analogde";
 	     $db_pass   = "rainbow";
	     //$db_type   = "mysql";
	     $db_name   = "analogde";
	  }
 	    
 	    print_r($_GET['tab']);
	  
	    /*echo "<br>";
	    print_r($_POST['choix']);
	    echo "<br>";
	    
	    $decompose = array();
	       
	    foreach($_POST['choix'] as $val)
	           {  $decompose[] = substr($val, 6, 3);
	           }

	    echo "<br>";   
	    print_r($decompose);
	    echo "<br>";
	    
	    // construire le requete
	    
	    for($i=0; $i<count($decompose); $i++) 
	    {   echo "<br>";
	    	echo $tab[$i];
	    	echo "<br>";
	    }
	    
	    $connexion = mysql_connect($db_host,$db_user,$db_pass); 
       	    mysql_select_db($db_name, $connexion);
	    
	    $requete = " SELECT * FROM cruchot WHERE chargement = 'Hublot' or chargement = '2' ";
	    $result = mysql_query($requete);
	    
	    echo mysql_num_rows($result); 
	    
	    
	    while( $list = mysql_fetch_array( $result) ) 
	    {   echo "<br>"; 
  		echo $list['id_catalogue'];
  		echo "<br>"; 
	    }	  */
	   
	    
?>	    