Hiya people,
I'm looking for a way to echo variables in a select box. What I want is a drop down box (select) with a few echoed variables which are extracted from a mysql database.
a little code:
<select name="categorie">
<?
$q = "SELECT catid, catnaam FROM categorie ORDER BY id";
$qr = mysql_query($q);
$qn = mysql_num_rows($qr);
$x = 0;
while ($x <= $qn)
{
extract(mysql_fetch_assoc($qr));
?>
<option value="<? echo $catid; ?>"><? echo $catnaam; ?></option>
<?
$x++;
}
?>
</select>
any ideas?