<?php

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$paper_id = $request->getAttribute('paper');
$response=array();


//paper start query
$sql = "SELECT units FROM units WHERE set_papers_id = $paper_id";

$result = mysqli_query($con,$sql);



while($row = mysqli_fetch_assoc($result)){
    $data = json_decode($row['units']);

    
   
  
}

echo json_encode($data);
?>