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 39 40
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
</head>
<body>
<?php
try
{
$bdd = new PDO('mysql:host=localhost;dbname=base', '', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
?>
<form method="post" action="">
<label for="type_entreprise">le type d'entreprise</label><br />
<select name="type_entreprise" id="type_entreprise">
<?php
$reponse = $bdd->query('SELECT * FROM type_entreprise');
while ($donnees = $reponse->fetch())
{
?>
<option value="<?php echo $donnees['type_entreprise']; ?>"> <?php echo $donnees['']; ?></option>
<?php
}
?>
</select>
</form>
</body>
</html> |
Partager