<?php
require_once('fetch.php');
$id = $_GET['id'];
$data = fetch_trends_data($id);
if($_GET['table'] == 'caste_data'){
    echo json_encode($data[0]);
}
if($_GET['table'] == 'occupation_data'){
    echo json_encode($data[1]);
}
if($_GET['table'] == 'agegroup_data'){
    echo json_encode($data[2]);
}
if($_GET['table'] == 'education_data'){
    echo json_encode($data[3]);
}
?>