next hurdle...
Joshua S. Freeman
jfreeman at amnh.org
Wed May 21 16:47:11 EDT 2003
Here's some code:
<?php
$query= mysql_query("select * FROM subfamily");
echo "<select name=\\"subfamily\\"><option value=\\"\\">--select
subfamily--</option>\
";
while ($row = mysql_fetch_row($query)) {
print "<option value=\\"$row[0]\\">$row[1]</option>\
";
}
print ("</select>");
?>
Here's the result:
<select name="subfamily">
<option value="">--select subfamily--</option>
<option value="1"></option>
<option value="2">Eumeninae</option>
<option value="3">Masarinae</option>
<option value="4">Polistinae</option>
<option value="5">Stenogastrinae</option>
<option value="6">Vespinae</option>
<option value="7">Undetermined</option>
</select>
which is *almost* what I want.
What I *want* is this:
<select name="subfamily">
<option value="">--select subfamily--</option>
<option value="1">Eumeninae</option>
<option value="2">Masarinae</option>
<option value="3">Polistinae</option>
<option value="4">Stenogastrinae</option>
<option value="5">Vespinae</option>
<option value="6">Undetermined</option>
</select>
Is there something I can change in my PHP code which will change the results
I have into the results I want?
J.
More information about the talk
mailing list