MySQL 5.7.8 and later began to support a native JSON type that can efficiently obtain data in JSON text. This type has the following advantages:
In addition, the system has some restrictions on the JSON format:
Problems encountered when inserting json data You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{ Insert code insert into `players` (`id`,`player_and_games`) values(1,{ "id":1, "name":"aaa", "games_played":{ "Battlefieldld":{ "weapon":"adsf", "level":20 }, "Crazy":{ "weapon":"adsf", "level":20 } } }) There is a problem, json does not use quotes, the correct way is as follows insert into `players` (`id`,`player_and_games`) values(1,'{ "id":1, "name":"aaa", "games_played":{ "Battlefieldld":{ "weapon":"adsf", "level":20 }, "Crazy":{ "weapon":"adsf", "level":20 } } }') Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: The principle and application of ES6 deconstruction assignment
>>: Detailed explanation of the use of umask under Linux
The cascading drop-down menu developed in this ex...
The Docker package is already included in the def...
Get daily statistics When doing a project, you ne...
Moreover, an article website built with a blog pro...
This article shares the specific code for the WeC...
<body> <div id="root"> <...
Background Recently, when writing SQL statements,...
In daily work, we sometimes run slow queries to r...
Whether MySQL needs to commit when performing ope...
1. Browser rendering mode and doctype Some web pa...
Preface Vue (pronounced /vjuː/, similar to view) ...
This article mainly introduces the implementation...
This article uses examples to illustrate the usag...
Using the html-webpack-plugin plug-in to start th...
Table of contents introduction Indexing principle...