返回列表 上一主題 發帖

請問如何對多筆資料加總後, 再利用其結果排序

請問如何對多筆資料加總後, 再利用其結果排序

$sql="SELECT * FROM newforum where type=121 and source=17 group by bc order by $noof asc";
$result=mysql_query($sql);
while (list($no,$date,$type,$title,$content,$ba,$bb,$bc,$bd,$be,$bf,$id,$mainname,$source,$position,$uploada,$uploadb,$uploadc,$updatetime,$hits,$postmemid,$posthktdname,$postidentity,$postclub)=mysql_fetch_row($result))
{
$rows=mysql_query("select * from newforum where type=121 and source=17 and bc=$bc");$noof=mysql_num_rows($rows);
echo $bc."-".$noof."<br>";
}

        靜思自在 : 有心就有福,有願就有力,自造福田,自得福緣。
返回列表 上一主題