高分求个php获取数据库内容排序的问题。问题解决外加50分!!!!!

来源:百度知道 编辑:UC知道 时间:2024/06/06 13:58:12
<?php
google_connect();
$sql="select * from tag where count='?????' order by count desc limit
100";
$result=mysql_query($sql);
while ($myrow=mysql_fetch_assoc($result))
{
?><a href="<?echo(urlencode($myrow[tag]));?>.html" target="_blank"><?
echo($myrow[tag]);?></a>
<?PHP
}
?>
获取语句是这个,表中的count是点击数。我要实现的是,获取出来的数据表是按count的值排序,从小到大或者从大到小。count='?????' 这里应该怎么写才可以?我是菜鸟,回答可以用另加50分。
哈哈,还真是菜鸟。by count desc limit
100";
这里就是按count降序排列。。。升序要怎么写?回答得分。

count应该是int类型的字段吧,如果你用count排序不用写where= 就写select * from tag order by count desc limit 100这个就是从大到小的前100个
select * from tag order by count asc limit 100就是从小到大的前100个

by count desc

改为

by count asc

asc