There are a lot of backslashes in the data stored in json format in Navicat for mysql. How to remove them?
巴扎黑
巴扎黑 2017-06-06 09:52:07
0
3
1381

When using mysql's json operation, it will be interfered by escape characters. It is normal to read it. I want to save it in the database without these backslashes

巴扎黑
巴扎黑

reply all(3)
世界只因有你

Visually, there is a problem with your storage. What you store is an array of strings, not an array of josn objects

某草草

Visually, it is related to the serialization library (or class) you are using. Let’s debug it with breakpoints before importing it into the library.

左手右手慢动作

Adding a backslash is for safety reasons, so it is best to add it. thinkphp's I method has data filtering. If you remove the filtering, there will be no backslashes.

You can separate the json data and store it in different fields

Or use serialize() to serialize the json data and store it, and then unserialize() it when taking it out

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!