<?php
$db = new mysqli('localhost', 'root', '', 'siakad');
$res = $db->query("SELECT id_program_studi, COUNT(*) FROM kelas_perkuliahan WHERE id_semester='20252' GROUP BY id_program_studi");
while($r = $res->fetch_assoc()) {
    print_r($r);
}

$res2 = $db->query("SELECT id, prodi_id, periode_masuk FROM mahasiswa LIMIT 5");
while($r = $res2->fetch_assoc()) {
    print_r($r);
}
