MySQL表到JSON? [英] MySQL table to JSON?
本文介绍了MySQL表到JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我有一个MySQL表格,如下所示:
Hello,
I have a MySQL-table looking like this:
Year|ZIP Code|Causes of Death|Count|Location
1999|90001 |SUI |0 |(33.973092999999999, -118.247896)
... |
我需要创建看起来像这样的JSON数据
And I need to create JSON data which looks like this
var data = [
[
'seriesA', [ latitude, longitude, magnitude, latitude, longitude, magnitude, ... ]
],
[
'seriesB', [ latitude, longitude, magnitude, latitude, longitude, magnitude, ... ]
]
];
因此从MySQL获取Location和Count列表格进入新的JSON文件。
谢谢!
So getting the "Location" and "Count" columns from the MySQL table into the new JSON-file.
Thanks!
推荐答案
不确定是什么阻止了你自己动手。
TutorialsPoint:带PHP的JSON [ ^ ]
W3Schhols:PHP MySQL数据库 [ ^ ]
你的JSON结构没有与你正在展示的桌子一起理解。
可能有一些你不知道的信息。
Not sure what is stopping you from doing it yourself.
TutorialsPoint: JSON with PHP[^]
W3Schhols: PHP MySQL Database[^]
Your JSON structure doesn't make sense together with the table you are showing.
There is probably some information you are not telling.
这篇关于MySQL表到JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文