Tag: json
-
Post Views: 15 Background A WordPress site I maintain, in order to enhance security protection, I have recently configured a global restriction rule in Nginx. Shortly after the configuration was completed, when editing the article, it was found that the tag could not be added and saved normally, and the browser console and nginx logs appeared frequently 429 Too Many…
-
Post Views: 22 1. In a custom field (location), it needs to be stored as a JSON format. UI design. as shown in Figure 1 2. In the interface design, the request parameter is longitude and latitude. Since the name of the location needs to be displayed in the details interface, the location name needs to be obtained based on…
-
Post Views: 18 1. In PHP, insert the JSON string (the Chinese has been encoded) into MySQL, and the Chinese has been encoded. as shown in Figure 1 2. Try to url decode the entire JSON string directly. Instead of converting JSON to an array, then traversing the array, url decoding each value, and finally encode the array into a…
-
Post Views: 19 1. The values in the JSON field are as follows. The fields to query: $.current.sections.announcement-bar.blocks.*.settings.text. The field key corresponding to * is unknown. as shown in Figure 1 2. The final sql is as follows, the query result is an array, if it does not exist, it is null. as shown in Figure 2 3. Announcement-bar needs…
-
Post Views: 17 1. The json field is stored in the array format, the value example:[249, 247, 250, 244, 243, 255, 246, 245, 257, 248, 259, 252, 256]. as shown in Figure 1 2. The existing code running in the queue job is implemented as follows, the generated SQL is as follows 3. Since the queue tasks can be run…
-
Post Views: 17 1. In MySQL 5.7, the data in the json type field is an array, and its value is:[365]. as shown in Figure 1 2. Reference: Query the constructor – where statement – json where statement:https://learnku.com/docs/laravel/6.x/queries/5171#35d9d9. JSON arrays can be queried using WhereJsonContains. as shown in Figure 2 3. The code is implemented as follows 4. Print the…
-
Post Views: 21 1. The front-end request parameters are shown below. as shown in Figure 1 2. The backend converts the parameter $args of the method __invoke to json, which corresponds to the field in the front-end request body: variables. The code is implemented as follows 3. Print the JSON as follows. There are more fields: directive, and then the…
-
Post Views: 21 1. Existing code implementation 2. The final generated structure is as follows, which is an array with the field name: SETTING_MIGRATIONS 3. Decide to adjust the name of the adjustment field as extra, and include the value of the setting_migrations field. The code is adjusted as follows, based on the helper function ar. 4. The final generated…
-
Post Views: 19 1. The code is as follows, set the value in the json field of mysql, and report an error: unsupported opera and types . as shown in Figure 1 2. The adjustment code is as follows 3. Implement a new JSON to the field when there is a value in the JSON field. The structure of the…