我有这种报告
我想像上图一样进行报告。 我已经用此代码尝试过:
$id = 0;
$id2 = 0;
$no = 1;
$q3 = mysql_query("SELECT * FROM pendidikan, unsur, subunsur WHERE pendidikan.id_sub = subunsur.id_sub AND subunsur.id_unsur = unsur.id_unsur AND pendidikan.nidn = $_GET[nidn]");
$q4 = mysql_query("SELECT * FROM pendidikan, unsur, subunsur WHERE pendidikan.id_sub = subunsur.id_sub AND subunsur.id_unsur = unsur.id_unsur AND pendidikan.nidn = $_GET[nidn]");
$data = array();
while($d=mysql_fetch_assoc($q3)){
$no++;
if($id != $d['id_unsur']){
$no = $no+1;
echo"<tr>
<td>$d[kode_unsur]</td>
<td colspan='8'>$d[nama_unsur]</td>
</tr>";
while($f=mysql_fetch_array($q3)){
if($id2 != $f['id_sub']){
echo"<tr>
<td rowspan='$no'>$d[kode_sub]</td>
<td colspan='8'>$d[nama_sub]</td>
</tr>";
}
$id2 = $f['id_sub'];
while($g=mysql_fetch_assoc($q4)){
if($g['id_sub'] == $f['id_sub']){
echo"<tr>
<td>$g[no_butir]</td>
<td>$g[uraian]</td>
<td>$g[thn_smt_akademik]</td>
<td>$g[tanggal]</td>
<td>$g[satuan_hasil]</td>
<td>$g[jml_vlm_kegiatan]</td>
<td>$g[jml_angka_kredit]</td>
<td>$g[bukti]</td>
</td>";
}
}
}
}
$id = $d['id_unsur'];
}
我应该怎么做,因为使用该代码,我使用相同的子A而不是B创建了这样的行:
任何帮助将不胜感激。谢谢。