我有一个表单选择框,它正确填充了 mysql 表中的值,但是当它发布时,发布的值是表“manutags”中的最后一项,而不是框中显示的选定项目。有人能告诉我我的逻辑有什么问题吗?
<p class="formlabel cf text nobox">Tag Style <!--popuplate with tag styles-->
<?$i=1;
while($i<11){?>
<select class="man_sty <?$m='man'.$i++;echo $m?>" name="style_id">
<?
$sql = "SELECT DISTINCT man,style_id FROM manutags WHERE man_id = '$m'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
?>
<option value="<?=$row[1];?>"><?echo $row[1]?></option><!-- tag dropdown values-->
<?}?>
</select>
<?}?>
HTML
<p class="formlabel cf text nobox">
Tag Style
<select class="man_sty man1" name="style_id_1" style="display: none;">
<option selected="" value="Kliktag">Kliktag</option>
<option value="RD2000">RD2000</option>
<option value="Button-R">Button-R</option>
<option value="SnappTagg">SnappTagg</option>
<option value="AutoEID">AutoEID</option>
</select>
<select class="man_sty man2" name="style_id_2" style="display: none;">
<option selected="" value="rototag">rototag</option>
</select>
<select class="man_sty man3" name="style_id_3" style="display: inline;">
<option selected="" value="Qwik">Qwik</option>
<option value="Zee">Zee</option>
</select>
</p>