<?php
		
require_once('connection.php');
$sql = "select idJenis,namaJenis from tblJenisKendaraan where statusData=1";
if(!$con->query($sql)){
    echo "Error in connecting to Database.";
}
else{
    $result = $con->query($sql);
    if($result->num_rows > 0){
        $return_arr['kendaraan'] = array();
        while($row = $result->fetch_array()){
            array_push($return_arr['kendaraan'], array(
                'namaJenis'=>$row['namaJenis']
            ));
        }
        echo json_encode($return_arr);
    }
}          
         
?>