<?php
include'config.php';
 
$query = "select * from tb_informasi";
$hasil  =mysqli_query($koneksi,$query);
 
 
if(mysqli_num_rows($hasil) > 0 ){
  $response = array();
  $response["tb_informasi"] = array();
  while($x = mysqli_fetch_array($hasil)){
    $h['id'] = $x["id_informasi"];
    $h['nama'] = $x["nama"];
    $h['pekerjaan'] = $x["pekerjaan"];
    $h['instansi'] = $x["instansi"];
    $h['alamat'] = $x["alamat"];
    $h['email'] = $x["email"];
    $h['telp'] = $x["telp"];
    $h['rincian'] = $x["rincian"];
    $h['tujuan'] = $x["tujuan"];
    $h['cara-memperoleh'] = $x["cara_memperoleh"];
    $h['cara_mendapatkan'] = $x["cara_mendapatkan"];
    array_push($response["tb_informasi"], $h);
  }
  echo json_encode($response);
}else {
  $response["message"]="tidak ada data";
  echo json_encode($response);
}
?>



