简体   繁体   中英

How to update mysql column using array

I am working with mysql, I have table "wp_notification" and here is currently strcture of table

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

In "UserId" column, i am saving Userid of users in "array" format using "serialize" function, but now i want to update( add one more user id in this column) this column So how can i do this ? Is this possible with mysql query only ?

You don't need to update the column. You can add one more user id in the future/current cells in that column.

It is worth noting however that using a "serialized" output string as an Id in a database is not a good solution. See Normalization in MYSQL .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM