Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 259 forks source link

学习一下,DAO->query出现的一些奇怪现象 #65

Closed lordGuan closed 6 years ago

lordGuan commented 6 years ago

数据库中某张表的某个字段存放的是json字符串,但是query出来所有的引号都变成了" --这个怎么解决

billge1205 commented 6 years ago

query出来的内容 是不会做任何修改的 你可以用客户端看下 数据是不是本身就是这样 另外 如果你用json_encode 再写入的话 本身就变成双引号 json是没有单引号的

lordGuan commented 6 years ago

尴尬了尴尬了,原来是Action里correct方法吧encode参数改成默认true了,前端项目接到的数据就有点儿问题,我以为是query出了问题(叨扰了叨扰了

billge1205 commented 6 years ago

嗯嗯 encode=true是在需要渲染页面的时候防止xss注入使用的 json返回一般用不到