简体   繁体   中英

json into mysql5 by php5

i'm trying to put json_encoded strings containing html tags into mysql5. the 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM