mysql storage json error
phpcn_u1582
phpcn_u1582 2017-06-06 09:52:13
0
1
811

Recently, I have been using mysql's json storage format, and a very strange problem has occurred.

INSERT INTO `json` (`notes`) VALUES ('[{"name":1}]');
I use the above statement to insert the json array, and the display of navicat is normal The

When I use
UPDATE json SET notes =json_array_append(notes, '$' , '["sa"]' ) WHERE ID=6 ;The escape character appears when adding new json

What's the problem?

phpcn_u1582
phpcn_u1582

reply all (1)
黄舟

json_array_append(notes, '$' , '["sa"]' )改为json_array_append(notes, '$' , CAST('["sa"]' AS JSON))

    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!