| AGALa boîte à Bokeh! | | Code : 
 function ListBox(&$valeurs,$index,$nom){	$res="\n\t<select name=\"$nom\">";	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;}function SelectDB($db, $index=0){  $sql='SELECT column1, column2 FROM table order column1';  $res=mysql_query($sql,$db);  while($myrow=mysql_fetch_array($res))  {  	$tab[$myrow[0]]=$myrow[1];  }  return ListBox($tab,$index,'listbox');}
 | 
 
 Salut,
 
 je n'arrive pas à optimiser ce code, dès l'instant où j'ai appel à deux trois fonctions appelant ListBox, ma page passe à 4sec de génération.
 
 
    |