<?php
$db = new mysqli('localhost', 'root', '', 'siakad');
$res = $db->query("SELECT kp.nama_mata_kuliah, mk.semester FROM kelas_perkuliahan kp LEFT JOIN mata_kuliah mk ON mk.nama_mata_kuliah = kp.nama_mata_kuliah AND mk.id_program_studi = kp.id_program_studi LIMIT 10");
while($r = $res->fetch_assoc()) {
    print_r($r);
}
