|
Posted by cover on 07/26/07 06:15
I'm trying to populate the pulldown menus of a single input form
through queries from a single table. The three columns are 'name',
'type', and 'status'. The name table runs to approx row 23, the type,
to row 8, and status, row 9. . I'm using the following code to
populate the form pulldown menus::
<?php
$query = "SELECT DISTINCT status
FROM $table";
$result = mysql_query($query);
$number = mysql_numrows($result);
for ($i=0; $i<$number; $i++) {
$status = mysql_result($result,$i,"status");
print "<option value=\"$status\">$status</option>";
}
mysql_close();
?>
The interesting portion here is that 'name' only allows a single blank
space on the pulldown as I had expected and so does 'status'. 'Type'
on the other hand, shows 2 blank spaces on the pulldown menu so what's
with that? Is there some sort of 'end of file marker' that I should
be inserting to the database columns to get this to read correctly?
TIA
[Back to original message]
|