加上下面一段:
//查询出每个分类下面的数量。
$result=mysql_query("select catid,count(*) as num
from list
group by catid");
while($row3=mysql_fetch_array($result)){
$arr[$row3['catid']]=$row3['num'];
}
while ($row1 = mysql_fetch_array($rs_type)) {?>
<?=$row1['typename']?> <?=$arr[$row1['typecode']]?>
<ul>