0) { while ($row = mysqli_fetch_assoc($result)) { $row["from_date"]=date('d-m-Y',strtotime($row["from_date"])); $row["to_date"]=date('d-m-Y',strtotime($row["to_date"])); $data = $row; } } else { $data['status'] = 200; $data['message'] = "Data not found!"; } echo json_encode($data); ?>