<?php


header('Content-Type: application/json');

include_once('../config/conn/db-connection.php');

$q = $db->query("SELECT household_id,count(purok_no) as group_purok, purok_no FROM  tbl_household GROUP BY purok_no")->fetchAll();

      $data = array();
      foreach ($q as $row) {
        $data[] = $row;
      }

    echo json_encode($data);
?>