} echo "{$nom}</option>"; } echo "</select>"; ?> </div> </div> <div class="form-group"> <label for="id_aoc" class="col-sm-2 control-label">Appellation</label> <div class="col-sm-10"> <?php // read the bouteille categories from the database include_once 'objects/AOC.php'; $aoc = new AOC($db); $stmt = $aoc->read(); // put them in a select drop-down echo "<select class='form-control' name='id_aoc'>"; echo "<option>Choisir l'AOC ...</option>"; while ($row_aoc = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row_aoc); // current aoc of the product must be selected if ($bouteille->id_aoc == $id) { echo "<option value='{$id}' selected>"; } else { echo "<option value='{$id}'>"; } echo "{$appellation}</option>"; } echo "</select>"; ?>