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 41 42 43 44 45 46 47 48
| <form method="POST" action="modif.php">
<ul>
<li>
<?php
try
{
$bdd=new PDO('mysql:host=localhost;dbname=dakar', 'root', '');
$reponse = $bdd->query("select nom from quartier");
?>
<label for="noms">Choisir le quartier:</label>
<select id="noms" name="noms" onchange="change()">
<?php
while ($data = $reponse->fetch()){
?>
<option><?php echo $data['nom']; ?></option>
<?php
}
?>
</select>
<?php
$reponse->closeCursor(); // Termine le traitement de la requête
}
catch(Exception $e)
{
// En cas d'erreur précédemment, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
?>
</li>
<li>
<label for="longitude">Longitude:</label>
<input type="text" size="40" id="long" name="long" disabled/>
</li>
<li>
<label for="longitude">Latitude:</label>
<input type="text" size="40" id="lati" name="lati" class="ajax"/>
</li>
<li>
<label for="longitude">Population:</label>
<input type="text" size="40" id="popu" name="popu" class="ajax"/>
</li>
</ul>
<p>
<button type="submit" class="action">Enregistrer</button>
<button type="reset" class="right">Annuler</button>
</p>
</form> |
Partager