AGA La boîte à Bokeh! | Salut,
   j'ai une fonction pour me faire des listbox "finger in the nose",
 mais je crois l'avoir codé avec les pieds (un seul   )
   >Voici le code en question
  
  Code :
 - La fonction général
 - function ListBox($valeurs,$index,$nom)
 - {
 - 	$res="\n\t<select name=\"$nom\">";
 - 	reset($valeurs);
 - 	foreach( $valeurs as $key => $valeur)
 - 	{
 -   $select = ($key==$index) ? ' selected=selected' : '';
 -   $res.="\n\t\t<option value=\"".$key."\"".$select.">$valeur</option>";
 - 	}
 - 	$res.="\n\t</select>\n\t";
 - 	return $res;
 - }
 - La fonction interface variant d'applis en applis...
 - function Select_LA_BELLE_LISTBOX_DU_MOMENT($db, $index=0)
 - {
 -   $sql='SELECT ch0, ch1 FROM table order by ch1';
 -   $res=mysql_query($sql,$db);
 -   while($myrow=mysql_fetch_array($res))
 -   {
 -   	$tab[$myrow[0]]=$myrow[1];
 -   }
 -   return ListBox($tab,$index,'utilisateur');
 - }
 
  |  
 
   Perfs minable  
   Une aide pour l'optimisation serait appréciée.
 Merci      |