Valek, on 21 March 2009 - 02:07 PM, said:
$dropdown = "<select name='users'>";
while($row = mysql_fetch_assoc($result)) {
$dropdown .= "\r\n<option value='{$row['username']}'>{$row['username']}</option>";
}
$dropdown .= "\r\n</select>";
echo $dropdown;
Is there a way to concatenate field name from my table within the <option> tags? In other words, I have a table with about 6 fields but I want to display three of them (per line) in a dropdown menu. I can't seem to figure out how/where to put different $row['field name'] elements to make them show up. I have the select query fine to pull them in, but can't display them to save my life. The field names are f_name l_name and paper and I would ideally like it to display : f_name l_name: paper.
Any help or advice would be appreciated! thank you!






MultiQuote


|