我有这个代码:
...............
else
if($fieldname_default == "Author"){
echo "<label class='control-label' for='".$fieldname_default."'>".$fieldname."</label>
<div class='controls'>
<select name='data[".$fieldname_default."]' id='".$fieldname_default."'>";
$get_categories_sql = mysql_query("select * from authors");
while($get_categories = mysql_fetch_assoc($get_categories_sql))
{
echo "<option value='".$get_categories['Author_Name']."'>".$get_categories['Author_Name']."</option>";
}
echo "</select>
</div></div>";
}
....................
我在哪里为ACS或DESC添加输入选项排序代码? 感谢有人回答。
答案 0 :(得分:1)
使您可以更轻松地按AuthorName更改查询,例如:
mysql_query("SELECT * FROM authors ORDER BY AuthorName ASC")