|
Posted by jsd219 on 06/13/07 21:48
Hello, George and Toby helped me out with a scripted to populate a
drop down box from a dynamic section:
I am having an issue with the drop down box. If there is only one row
in the table the drop down box will display nothing. once the table
has two or more rows the drop down displays the row but always one shy
of the total. here is the script i am using:
$query = "SELECT SEC_TITLE
FROM section
WHERE SEC_TITLE != ''";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ echo "<form action='#'>\r\n<select name=section>\r\n";
while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
$section = $line[0];
echo " <option value=$section>$section\r\n";
}
}
If anyone can help me get this drop down box to display all rows even
if there is only one row, i would really appreciate it.
Thanks
God bless
jason
Navigation:
[Reply to this message]
|