<?php
require_once "connection.php";

$sql = "SELECT namaBulan FROM tblBulanPinjaman WHERE statusData=1 ORDER BY idBulan ASC";

$result = $con->query($sql);

if ($result->num_rows > 0) {
    $return_arr['bulan_pinjaman'] = array();
    while ($row = $result->fetch_assoc()) {
        array_push($return_arr['bulan_pinjaman'], array(
            'namaBulan' => $row['namaBulan']
        ));
    }
    echo json_encode($return_arr);
} else {
    echo json_encode(["bulan_pinjaman" => []]);
}
?>
