opteronn
opteronn

Reputation: 176

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.

Upvotes: 0

Views: 82

Answers (1)

Tyler Eaves
Tyler Eaves

Reputation: 13133

mysql_real_escape_string($s);

Upvotes: 1

Related Questions