I've been beating my head all day because of this.
How to convert the results from the image above into json format like this
{
"name": "João Batista Da Silva Júnior",
"y": "9.83",
"drilldown": "João Batista Da Silva Júnior",
"data": [
[
"assiduidade",
10
],
[
"normas",
9
],
[
"eficiencia",
10
],
[
"relacionamento",
10
],
[
"iniciativa",
10
],
[
"visao",
10
]
]
}
]
}
I'm trying this code but it doesn't reproduce the format required.
$info["aval"] = array();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row);
$info2 = ['name' => $auxiliar, 'y' => $media, 'drilldown' => $auxiliar, 'data' => [[$topico, floatval($nota)]]];
$info["aval"][] = $info2;
}