I get the following exception:
SQLSTATE[22032]: <<Unknown error>>: 3140 Invalid JSON text: "Missing a comma or '}' after an object member." at position 19 in value for column 'requests.calendar_attendee'.
(SQL: UPDATE `requests` SET `calendar_attendee` = (CASE WHEN `id` = '31241690' THEN '{"firstName":"jon \"doe\""}'
ELSE `calendar_attendee` END), `updated_at` = (CASE WHEN `id` = '31241690' THEN '2022-11-17 20:48:36'
ELSE `updated_at` END) WHERE `id` IN("31241690");)
I am aware that using case when then does not make sense for this query. The actual query can have many more cases.
I don't understand what it is complaining about. The json is valid:
{"firstName":"jon \"doe\""}
You need to escape the back slash as well:
Try: THEN '{"firstName":"jon \\"doe\\""}'
You can check it here: https://dev.mysql.com/doc/refman/5.7/en/json.html#json-values
search on that page for "escape"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With