
Forum » » Le coin des codeurs » » Affichage d'un select
Posté : 28-02-2007 21:32 
<?php
echo "<select name=\"categorie\">";
$result = mysql_query("SELECT id_cat,categorie FROM ".$NPDS_Prefix."citation_cate order by categorie ASC ");
while($categorie = mysql_fetch_assoc($result)) {
echo "<option value=\"".$categorie["id_cat"]."\"";
if($categorie["id_cat"] == $id_cat)
echo " selected=\"selected\"";
echo ">".$categorie["categorie"]."</option>";
}
echo "</select>";
Message édité par : Boris / 28-02-2007 21:41
Cet article provient de NPDS REvolution 16
https://lab.grottes-et-karsts-de-chine.org/viewtopic.php?topic=22015&forum=5