开发者

json into mysql5 by php5

开发者 https://www.devze.com 2023-01-30 07:10 出处:网络
i\'m trying to put json_encoded strings containing html tags into mysql5. 开发者_如何学JAVAthe problem is that the data in mysql seems automatically unescaped all \"s. data is fed by POST and i\'m usi

i'm trying to put json_encoded strings containing html tags into mysql5. 开发者_如何学JAVAthe problem is that the data in mysql seems automatically unescaped all "s. data is fed by POST and i'm using standard mysql_query.

if i print any json string into browser it shows as correctly escaped, \". but when inserted into mysql all \"s became "s. naturally unescaped "s make string non-json. any solutions will be appreciated.


mysql_real_escape_string($s);
0

精彩评论

暂无评论...
验证码 换一张
取 消