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
| function sgbd()
{
// liste déroulante -------------------------------------------
echo 'SGBD: ';
echo '<form method="post">';
echo '<select name="sgbdName" >',"\n";
$s_sqlSelect = "SELECT nomrubrique, id_rubrique
from rubrique
where id_rubrique_parent = :id_rubrique
order by nomrubrique";
$dbh = $this->dbh;
$o_sqlResult = $dbh->prepare($s_sqlSelect,array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$o_sqlResult->execute(array(':id_rubrique' => 1));
while ($o_result = $o_sqlResult->fetch())
{
echo "\t",'<option>', $o_result['nomrubrique'], '</option>',"\n";
}
echo '</select>';
echo '<input type="submit" value="OK" /> ';
echo '</form>';
if (isset($_POST['sgbdName'])) // On vérifie si le visiteur a déjà choisi
{
echo '<p>choix : ' . htmlspecialchars($_POST['sgbdName']) . '</p>';
} |
Partager