我正在尝试使用我的所有货币创建一个下拉列表,目前值为 1、2 和 3。我需要下拉列表的值保持为数字,但希望选项文本显示 GBP、EUR和美元代替。我有这个代码:
<select class='dc_input' name='currency' id ='currency'>
<?php
$sql="SELECT l.currency
FROM locations l
GROUP BY l.currency";
$sites = mysql_query($sql);
while ($row = mysql_fetch_assoc($sites)) {
echo '<option value="' .$row['currency']. '"' .$selected. '> </option>';
}
?>
</select>
这行得通,我只是不知道要放入什么来使其每个都改变。