我在汇总表中有这些数据:
REGIS_ID VAC_NAME LOC_DETAIL
1 Flu University
2 Flu University
3 Flu University
4 Flu Office
5 Flu School
6 Flu Office
7 Flu School
8 Flu School
9 Flu School
10 Flu School
11 Flu University
12 Flu University
13 Hepatitis-B School
14 Hepatitis-B School
15 Hepatitis-B School
16 Hepatitis-B Office
17 Hepatitis-B Office
18 Bird_Flu University
19 Bird_Flu University
20 Bird_Flu School
21 Bird_Flu School
22 Bird_Flu School
23 Bird_Flu Office
24 Bird_Flu Office
25 Bird_Flu University
所以我想查询并将数据转换为PHP,如下所示:
$dataTest = "['', 'Bird_Flu', 'Flu', 'Hepatitis-B'],
['School', 3, 5, 2],
['University', 3, 5, 3],
['Office', 2, 2, 2]";
制作Google Chart:
我该怎么办?非常感谢你。
答案 0 :(得分:0)
我过去做了类似的事情,我只是用代码来构建所需格式的字符串
//sudo code
$dataTest = ""
foreach(datarow)
{
$dataTest += "['School', 3, 5, 2],"
}