<?php
$details = array();
$json_file_name = "description.json";
$sql2 = "SELECT * FROM tbl_decriptions";
$row2 = getList($sql2);
foreach($row2 as $result){
    $detail = new stdClass(); 
    $detail->id = $result['id'];   
    $detail->Description = $result['Description'];   
    $detail->Type = $result['Type'];   
     array_push($details, $detail); 
     $final_data = json_encode(array('details' => $details));
    if(file_put_contents('../json_files/'.$json_file_name, $final_data)){}
    
}
?>