当我尝试从mysql输出复杂json的记录以发送回jquery时,我遇到了问题......
我的桌子
bil iduser name experience
0 001 jacobs bus driver
1 002 max painter
2 001 jacobs racing driver
3 003 john engineer
4 001 jacobs retiree
5 002 max designer
6 003 john senior engineer
欲望的json结果应该是
[
{
"iduser":001,
"name":"jacobs",
"exprience":[{"exp":"bus driver"},{"exp":"racing driver"},{"exp":"retiree"}]
},
{
"iduser":002,
"name":"max",
"exprience":[{"exp":"painter"},{"exp":"designer"}]
}
]
等等......我对简单的json格式没关系,但是这种复杂的格式我完全失败了...在这里坚持......
希望有人能告诉我如何使用php格式化它