[nycphp-talk] next hurdle...
Nasir Zubair
lists at ny-tech.net
Wed May 21 16:53:28 EDT 2003
How about this:
<?php
$query= mysql_query("select * FROM subfamily");
echo "<select name=\\"subfamily\\"><option value=\\"\\">--select
subfamily--</option>\
";
while ($row = mysql_fetch_row($query))
{
if($row[0] != "" && $row[1] != "")
print "<option value=\\"$row[0]\\">$row[1]</option>\
";
}
print ("</select>");
?>
-------Original Message-------
From: talk at nyphp.org
Date: Wednesday, May 21, 2003 4:47:40 PM
To: NYPHP Talk
Subject: [nycphp-talk] next hurdle...
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.
--- Unsubscribe at http://nyphp.org/list/ ---
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030521/70650438/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMSTP.gif
Type: image/gif
Size: 494 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030521/70650438/attachment.gif>
More information about the talk
mailing list