时间:2021-07-01 10:21:17 帮助过:27人阅读
$sql="select a.id, a.name , count(b.id) as num from user a left join bbslist b on b.userid=a.id group by b.userid order by num desc";
$r=mysql_query($sql);
while($row=mysql_fetch_assoc($r)){
echo $row['name'] .'------------' . $row['num'] .'篇
';
}