0

I have one JSON column ('posts') in MYSQL table . When somebody posts something i want to add this data to this column like this { "status": "active", "id": "112" }

I can only do this "UPDATE users set posts = ? WHERE id = ? " But it deletes and writes data into 'posts' . I need to append data to the beggining of json data. My question is simple example of adding json data and updating data (for example where id='112' status='archived')

Thanks in advance

  • 1
    Don't do that. Create a table for posts. – Salman A Dec 10 '21 at 10:45
  • As Salman A said - don't do it. It smells! But assuming you are ignoring his advice, please update your question to include the CREATE TABLE statement, an example of what a row looks like and what you want it to be after applying your update. – user1191247 Dec 10 '21 at 16:12

0 Answers0