I want to update the column 'page_inv', so it will replace two last chars of this column, and add new data, for example:
'{"userItems":[{item1}]}' -> '{"userItems":[{item1}' -> '{"userItems":[{item1}, {item2}]}'
UPDATE `users`
SET `page_inv`=CONCAT((SELECT `page_inv`, SUBSTRING( `page_inv`, 1, CHAR_LENGTH( `page_inv` )) -2), ',{newItem}]}')
WHERE `STEAMID`=76561198147
My DB:
Something like this?
UPDATE `users`
SET page_inv= CONCAT(left(page_inv, length(page_inv) - 2), ',{newItem}]}')
WHERE STEAMID = 76561198147;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.