You are here: drop down not displaying all rows « PHP Programming Language « IT news, forums, messages
drop down not displaying all rows

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация