saya mau tanya nih mas gimana caranya meng-count tapi
bersumber dari bbrpa tabel jumlah sks,
bentuk tabel'y seperti ini
//tabel krs
CREATE TABLE `krs` (
`id_krs` int(10) NOT NULL auto_increment,
`NIMHS` varchar(10) NOT NULL,
`KDSEMES` int(2) NOT NULL,
`TAHUN` int(4) NOT NULL,
`NMGANGEN` varchar(5) NOT NULL,
`STATUS` varchar(10) NOT NULL,
PRIMARY KEY (`id_krs`)
//trans_krs
CREATE TABLE `trans_krs` (
`id_trankrs` int(4) NOT NULL auto_increment,
`id_krs` int(10) NOT NULL,
`KDJADWAL` varchar(6) NOT NULL,
`BU` varchar(1) NOT NULL,
PRIMARY KEY (`id_trankrs`)
//tabel jadwal1
CREATE TABLE `jadwal1` (
`KDJADWAL` int(10) NOT NULL auto_increment,
`HARI` varchar(10) NOT NULL,
`JAM` varchar(12) NOT NULL,
`KDMKM` varchar(10) NOT NULL,
`NIDN` varchar(10) NOT NULL,
`kdkelas` char(2) NOT NULL,
`KDRUANG` varchar(5) NOT NULL,
PRIMARY KEY (`KDJADWAL`),
KEY `KDMKM` (`KDMKM`),
KEY `NIDN` (`NIDN`),
KEY `KDRUANG` (`KDRUANG`)
//tabel makul
CREATE TABLE `makul` (
`KDMKM` varchar(10) NOT NULL,
`NAKMK` varchar(25) NOT NULL,
`SKSMK` int(2) NOT NULL,
`SKSTM` int(2) NOT NULL,
`SKSPR` int(2) NOT NULL,
`SKSLP` int(2) NOT NULL,
`SEMES` varchar(1) NOT NULL,
`KDWP` varchar(1) NOT NULL,
`KDPS` int(2) NOT NULL,
`KDKUR` varchar(3) NOT NULL,
`KDPRODI` varchar(4) NOT NULL,
`KDJEN` varchar(1) NOT NULL,
`KDPT` varchar(7) NOT NULL,
PRIMARY KEY (`KDMKM`)
dan ini php'y
$result = mysql_query("select count(makul.SKSMK) as total from krs,trans_krs,jadwal1,makul where krs.NIMHS='$_SESSION[NIDN]' and krs.KDSEMES='$semester' and krs.TAHUN='$tahun'");
mohon pembenarannya krna saya bingung dg tabel penghubungnya dari bbrapa tabel.