<?php
$db = mysqli_connect('127.0.0.1', 'root', '', 'siakad');
$res = mysqli_query($db, "SELECT id_program_studi, nama_program_studi, COUNT(*) as count FROM penugasan_dosen GROUP BY id_program_studi, nama_program_studi");
while($row = mysqli_fetch_assoc($res)) {
    echo $row['id_program_studi'] . " | " . $row['nama_program_studi'] . " | " . $row['count'] . "\n";
}
