<?php

			session_start();
			include('database.php');
			DB_connexion(); 

function recuperer_projet($nom_famille)
{
			$tab_tmp = array();
			
			$sql = "SELECT * FROM projet WHERE famille = '$nom_famille' ";
			
			$retour = mysql_query($sql);   
			$nb_resultats = mysql_num_rows($retour);
			
			if( $nb_resultats > 0 )
     		{
				while($data=mysql_fetch_assoc($retour)) 
				{	
					array_push($tab_tmp,$data["nom_projet"]);
				}				
			}
			
			//echo "<br>";
			//echo "<pre>";
			//print_r($tab_tmp);	
			
			return($tab_tmp);
}			


			

			$tmp = array();
			$tab_famille_projet = array("PMIC", "SBC", "Wearable", "Wireless");
			
			$tmp[] = recuperer_projet($tab_famille_projet[0]);
			$tmp[]  = recuperer_projet($tab_famille_projet[1]);
			$tmp[]  = recuperer_projet($tab_famille_projet[2]);
			$tmp[]  = recuperer_projet($tab_famille_projet[3]);
			echo "<pre>";
			print_r($tmp);	
			echo "<br>";
			
			

			
			
			
			
?>