额,用sql的话SELECT count(catid),catid FROM `phpcms_news` GROUP BY catid ORDER BY COUNT(catid) DESC 把catid换成你的字段