SELECT calon_siswa.namalengkap,calon_siswa.tempatlahir,calon_siswa.tgllahir,siswaseleksi.no_seleksi,keahlian.nm_keahlian,lolos.ket FROM calon_siswa INNER JOIN siswaseleksi ON calon_siswa.no_daftar = siswaseleksi.no_daftar INNER JOIN keahlian ON calon_siswa.kd_keahlian = keahlian.kd_keahlian INNER JOIN lolos ON siswaseleksi.no_seleksi = lolos.no_seleksi
WHERE siswaseleksi.no_seleksi like '%$no_seleksi%' lolos.ket='DITERIMA' " ;
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0){
?>
<?php
$rowset = mysql_query(" SELECT calon_siswa.namalengkap,calon_siswa.tempatlahir,calon_siswa.tgllahir,calon_siswa.jk,calon_siswa.agama,calon_siswa.asalsekolah,calon_siswa.alamat,calon_siswa.namaortu,calon_siswa.pekerjaanortu,siswaseleksi.no_seleksi,siswaseleksi.no_ruang,keahlian.nm_keahlian,lolos.nilai,count(*) as jml, lolos.ket FROM calon_siswa INNER JOIN siswaseleksi ON calon_siswa.no_daftar = siswaseleksi.no_daftar INNER JOIN keahlian ON calon_siswa.kd_keahlian = keahlian.kd_keahlian INNER JOIN lolos ON siswaseleksi.no_seleksi = lolos.no_seleksi
WHERE keahlian.kd_keahlian='$kd_keahlian' and year(calon_siswa.tanggal) = '$tahun' group by (lolos.ket) ") ;
$jmlpendaftar=mysql_num_rows($rowset);
echo "<strong> Jumlah Pendaftar: </strong><B>$jmlpendaftar</B> Siswa<BR><BR> $rowset[jml]";
?>
mas belum nampil....koreksinya ya, <?php
$rowset = mysql_query(" SELECT count(*) as jml, lolos.ket FROM calon_siswa INNER JOIN siswaseleksi ON calon_siswa.no_daftar = siswaseleksi.no_daftar INNER JOIN keahlian ON calon_siswa.kd_keahlian = keahlian.kd_keahlian INNER JOIN lolos ON siswaseleksi.no_seleksi = lolos.no_seleksiWHERE keahlian.kd_keahlian='$kd_keahlian' and year(calon_siswa.tanggal) = '$tahun' group by (lolos.ket) ") ;
while($data = mysql_fetch_array($rowset)){
echo 'Siswa '.$data['ket'].':'.$data['jml'].'<br/>';
}
?>