Bonjour,
je vais essayer d'etre clair dans mes explications.
J'ai une requete qui me renvoie x lignes de résultats.
Ces x résultats vont me servir pour un formulaire.
Je voudrais nommer les input text en les incrémentant de 1 à chaque resultat.
Au final il me faudrait des input text choixIng1,choixIng2... Qte1, Qte2... Unite1,Unite2...
Est-ce que quelqu'un peut me mettre sur la piste ?
Merci à tous
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 $ingredient=mysql_query("select i.Ingredient,i.NumeroLot,s.IdIngredient,s.NumeroLot,s.Unite,s.DLUO,s.Qte from Ingredients i,StockIngredients s where i.NumeroLot like s.NumeroLot and i.Ingredient like '".$row['Ing1']."%' group by s.NumeroLot order by s.DLUO"); $nombre = mysql_num_rows($ingredient); while ($row2=mysql_fetch_array($ingredient)) { if($row['Unite1']=="l") $unite="litres"; else if($row['Unite1']=="gr") $unite="grammes"; else if($row['Unite1']=="kg") $unite="kilos"; else if($row['Unite1']=="cl") $unite="centilitres"; else if($row['Unite1']=="p") $unite="pièces"; $poidsT=$_POST['Litrage']*$row['poids1']; echo " <tr> <td height='10' valign='middle' class='LienBordeaux' width='20%'> <input type='hidden' name='choixIng' value='".$row2['IdIngredient']."'> - ".$row2['Ingredient']." </td> <td width='15%'> ".$row2['NumeroLot']."</td> <td width='20%'> <b>".date_to_fr($row2['DLUO'])."</b> </td> <td width='15%'> ".number_format($row2['Qte'],2)." ".$row2['Unite']."</td> <td width='30%'>Qté <input type='text' name='Qte' id='' size='10'> Unite <select name='Unite' class='menu'> <option value=''> </option>"; $unite=mysql_query("select * from Unite order by IdUnite"); while ($row3=mysql_fetch_array($unite)) { echo "<option value=".$row3['Unite'].">".$row3['Unite']."</option>"; } echo " </select> </tr>"; }}
Partager