<?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";
	  }
     	
     	$connexion = mysql_connect($db_host,$db_user,$db_pass); 
       	mysql_select_db($db_name, $connexion);
  
  	$table = "washer"; 
  
	$requete = "SELECT id_catalogue FROM $table WHERE marque IN ('Brandt', 'Bosh' ) and chargement = 'Hublot' and vitesse_essorage_trs_min = 1200 and capacite_lavage_kg = 6 and classe_efficacite_essorage = 'A+++' ";

	$requete = "SELECT * FROM $table  WHERE chargement = 'Hublot' ";

	// toute la table
	$requete = "SELECT * FROM $table  ";

	
	$result = mysql_query($requete);
    	
    	$nb_result = mysql_num_rows($result);
    	
    	if($nb_result != 0)
	  { 	    	
    	    while($datas = mysql_fetch_assoc($result))
                 {
                   echo  $datas['id_catalogue'];
                   echo "<br>"; 
                 }
          }
          else { echo "Aucune réponse";}     

    	//$result = mysql_query($requete);
    	//$datas = mysql_fetch_array($result);
	//var_dump($datas);	


?>