<?php
$mysqli = new mysqli("127.0.0.1", "root", "", "siakad");

$query = "SELECT k.nama_mata_kuliah, m.semester, m.id_kurikulum, k.id_semester, p.nama_prodi 
          FROM kelas_perkuliahan k 
          LEFT JOIN program_studi p ON p.id = k.id_program_studi 
          LEFT JOIN mata_kuliah m ON m.nama_mata_kuliah = k.nama_mata_kuliah AND m.id_program_studi = k.id_program_studi
          WHERE p.nama_prodi = 'Teknologi Informasi' AND k.id_semester = '20252'";

$res = $mysqli->query($query);
while($row = $res->fetch_assoc()) {
    print_r($row);
}
