php - Syntax error in JSON path in argument 2 to function 'json_set' at position 1
Get the solution ↓↓↓while update record in json it shown me " Syntax error in JSON path in argument 2 to function 'json_set' at position 1"
my query is
UPDATE wp_users
SET stress_email_details = JSON_SET(stress_email_details, 2021 ,1)
where id = 349
i wrote in wordpress like
$wpdb->get_row($wpdb->prepare("UPDATE $usersTable SET stress_email_details = JSON_SET(stress_email_details, '$.$b' ,'$.$currentWeek->week') where id = $activeUser->ID",0));
my desired output like.
i have empty stress_email_details field.
when i update row it will store
likes {'2021' : 1}
and next when i update again it will update like
{2021 : 1 , 2021: 2 } or {2021 : {1,2,3,...}} or {2021 : {1,2,3,...}, 2022 : {1,2,3,...}}
i just want to store 2021 is year and 1 is week of year.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: using $this when not in object context laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.