I cant insert this query into mysql. I did a json.dump(). I tried text and blob. I tried opening and closing quotes.
INSERT INTO mytable (campaign_object)
VALUES ( {"cpa_type": "null", "device_tablets": "True",
"language": "all", "end_date": null, "bid": "1", "budget": "1", "goal_type": "ctr",
"frequency": "null", "location": "all", "device_mobile": "True", "device_desktop":
"True", "impressions": "null", "campaign_name": "1", "start_date": "2012-09-14",
"insert_date": "2012-09-13 23:00:1347548413"})
So…I would have to imagine that MyhSQL can handle json. I really do want want to pickle.
Always use parameterized queries.
This way you avoid needing to escape your json, and you’re safe from SQL injection.