search

Home  >  Q&A  >  body text

How to update mysql column using array

I am using mysql, I have table "wp_notification", here is the current structure of the table

id              UserId                PostId              status
1               s:1:"8";              26                  accept

In the "UserId" column I saved the user's Userid in "array" format using the "serialize" function, but now I want to update (add one more user id in this column) this column So what do I do? Is it ok to just use mysql query?

P粉098417223P粉098417223280 days ago323

reply all(1)I'll reply

  • P粉790819727

    P粉7908197272024-02-26 11:25:02

    You do not need to update this column. You can add another user ID in the future/current cell of this column.

    However, it is worth noting that using "serialized" output strings as Ids in the database is not a good solution. See Normalization in MYSQL.

    reply
    0
  • Cancelreply