Bonjour,
Etudiant en DUT MMI, j'ai un petit soucis pour une requête, je m'explique.
Nous devons réaliser un site de voyage, j'ai une table voyages sur ma BDD, le code ci-dessous fonctionne parfaitement à une exception prêt, c'est que dans mon selecteur, il m'affiche 4 fois le même " thème " de voyage, oui car dans la bdd chaque voyage a un thème attribué.
Je voudrai qu'il m'affiche seulement une fois le thème en question.
Voila le code et une capture d'écran du résultat !
Merci d'avance
LE RESULTAT:
http://hpics.li/ccf1d7a
LE CODE :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dutaf</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="content col-md-10 col-md-offset-1">
<h1>Selection d'un pays</h1>
<form method="POST" role="form" action="rep_requete_theme.php">
+ bouton selct fournisseur en dessous -->
<?php
include ('config.php');
$db=new mysqli(BDD_SERVEUR,BDD_USER,BDD_PASS,BDD_BDD);
$req='SELECT * FROM voyages ORDER BY voyage_theme';
$tous=$db->query($req); //execution
?>
<select class="form-control" name="theme">
<?php
while ($untheme=$tous->fetch_object()) {
echo '<option value="'.$untheme->voyage_id.'">'.$untheme->voyage_theme.'</option>';
}
?>
</select>
<?php
$db->close();
?>
<br/>
<div class="form-group">
<button type="submit" class="btn btn-default">Envoyer</button>
</div>
</form>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="
https://ajax.googleapis.com/ajax/libs/j ... "></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>