mas, tabel saya isi itu
no_akun,nama_akun,tipe_akun
isi'a
10001,kayu,BBB
30001,BTKL,BOP
30002,Lem,BOP
nah,saya mau tampilin gni mas di halaman tampil saia,
1 BBB
10001 kayu BBB

3 BOP
30001 BTKL BOP
30002 Lem BOP

nah,itu gmn sh mas script'a?? mohon bantuan'a dong mas...
terima kasih
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Feb 25, 2012 · 0 Suka · 0 Tidak Suka
$sqlGroup = mysql_query("select count(no_akun) as jml, nama_table.* from nama_table group by tipe_akun");
while($group = mysql_fetch_array($sqlGroup)){
	echo $group['jml'].' '.$group['tipe_akun'];
	$sqldetail = mysql_query("select * from nama_table where tipe_akun='".$group['tipe_akun']."'");
	echo '<ul>';
	while($detail = mysql_fetch_array($sqldetail)){
		echo '<li>'.$detail['no_akun'].' '.$detail['nama_akun'].' '.$detail['tipe_akun'].'</li>';
	}
	echo '</ul>';
}
tampilan data silahkan sesuaikan sendiri