Bonjour ,
j'ai un petit soucis avec un formulaire sur lequel je souhaiterais pouvoir récupérer la sélection que j'ai fait. Ça ne marche que sur un seul enregistrement j'aimerais comprendre pourquoi.
Code:
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 <?php $rubriquedesc = new Rubriquedesc(); $query = "select id as idRub,titre from $rubriquedesc->table "; $resul = mysql_query($query); //si modification $bonreduction_rubrique = new Bonreduction_rubrique(); $sql = "select rubrique_id from $bonreduction_rubrique->table where bondereduction_id = $id"; $bdr_rubrique_selected_ids =array(); $resultsBdrRub = mysql_query($sql); $bdr_rubrique_selected_ids = mysql_fetch_array($resultsBdrRub); ?> <select id="Produits" multiple="multiple" name="Product[]" class="double_list_select-selected" size="10"> <optgroup label="Rubriques"> <?php while($row = mysql_fetch_object($resul)) : ?> <option value="r_<?php echo $row->idRub; ?>" <?php echo in_array($row->idRub, $tab) ? 'selected = "selected"' : '' ; ?> ><?php echo $row->titre; ?></option> <?php endwhile; ?> </optgroup> </select>
