Home > Backend Development > PHP Tutorial > mysql to json的有关问题

mysql to json的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:40:14
Original
859 people have browsed it

mysql to json的问题
我想生成嵌套的json的格式不知道怎么做。。。
比方说我要查询用户=aa的数据,可能不止一行:$row=mysql_fetch_array($rs);
结果可能是多行的: {{id=1,account=123,depart=xxx},{id=22,account=323,depart=kkk}}
我希望生成这样的json格式:
{user:aa,[{id=1,account=123,depart=xxx},{id=22,account=323,depart=kkk}]}应该怎么做?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template