<?php

		
		session_start();

		$id = "NTH82K";
		  
		/* Initialisation du panier */
    		$_SESSION['panier'] = array();
    		
    		
    		/* Subdivision du panier */
    		$_SESSION['panier']['id'] = array();
    		$_SESSION['panier']['qte'] = array();
    		$_SESSION['panier']['designation'] = array();
    		$_SESSION['panier']['prix_ttc'] = array();
		$_SESSION['panier']['prix_ht'] = array();
		

		$connexion = mysql_connect("localhost", "root", "");
        
	   	 mysql_select_db("boutique", $connexion);

		$requete = "SELECT * FROM lave_linge WHERE modele='$id'";
		$result = mysql_query($requete);
	
		$data  = mysql_fetch_assoc($result);
			 
		echo $data["modele"];
		echo $data["prix_ttc"];    
		
		$select['id'] = $data['id'];
	      	$select['qte'] = 14;
		$select['designation'] = $data['modele'];	
		$select['prix_ttc'] = $data['prix_ttc'];
		$select['prix_ht'] = $data['prix_ht'];
		ajout($select); 
		
		
		//$_SESSION['un']  = $data["modele"];
  		//$_SESSION['deux'] = $data["prix_ttc"];  
		
		print_r($_SESSION);
			
		session_destroy();
	
  	  
  	  
	  
	  			

		
		

?>

<?php
function ajout($select)
{
    array_push($_SESSION['panier']['id'],$select['id']);
    array_push($_SESSION['panier']['qte'],$select['qte']);
    array_push($_SESSION['panier']['designation'],$select['designation']);
    array_push($_SESSION['panier']['prix_ttc'],$select['prix_ttc']);
    array_push($_SESSION['panier']['prix_ht'],$select['prix_ht']);
} 

?>