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
| <form method="post" action="LesNews.php">
<table>
<tr>
<td>
<?php
//Connection
try {
$pdo_options[PDO::ATTR_ERRMODE]=PDO::ERRMODE_EXCEPTION;
$bdd=new PDO('mysql:host=localhost;dbname=Bd_New','root','',$pdo_options);
} catch (Exception $e) {
die('Erreur:'.$e->getMessage());
}
echo "<select name='date_evenement'>";
$New=$bdd->query("SELECT date_evenement FROM LesNews");
while($data=$New->fetch())
{
echo "<option>".$data[date_evenement]."</option>";
}
echo "</select>";
$recup= $_POST['date_evenement'];
$New->closeCursor();
?>
</td>
<td>
<?php
echo "<p>".$recup."</p>";
?>
</td>
</tr>
</table>
</form> |
Partager