Voici mon problème...
Je n'arrive pas a afficher aucune information dans mes options de mon select...
Voici un morceau du code :
<select name="choiceCity">
<?php
try
{
$bdd=new PDO('mysql:host=localhost;dbname=weather','root','');
}
catch(Exception $e)
{
die('Erreur :'.$e->getMessage());
}
$sel=$bdd->prepare('SELECT city FROM wheathertable');
$sel->execute;
while($data=$sel->fetch()){
echo '<option value="'.$data->city.'">'.$data->city.'</option>';
}
$sel->closeCursor();
?>
</select>
J'ai tester aussi ce code en gardant la connexion a la base de données plus haut :
<?php
$sel=$bdd->query('SELECT city FROM wheathertable');
while($data=$sel->fetch()){?>
<option value="<?php echo $data['city']; ?>"> <?php echo $data['city']; ?></option>
<?php}
$sel->closeCursor();
?>
et la PHP me dit que Parse error: syntax error, unexpected end of file in... Je ne vois pas d'erreur...Si quelqu'un peut m'aider, d'avance merci..