如何更新已序列化数据的Mysql行? [英] How to update Mysql row that has serialized data?

查看:107
本文介绍了如何更新已序列化数据的Mysql行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2000个产品,其中row是使用序列化数据,我需要更新特定的字符串



这是行名数据

  a:35:{s:11:expire_days; s:3:30d; s:12:trial1_price ; s:11:trial1_days; s:0:; s:12:is_recurring; s:0:; s:10:start_date :terms; s:24:每个授权1美元150美元s:12:rebill_timess:0:s:15:paypal_currencys:0: :## 11; N:s:3:url; s:0:; s:8:add_urls; s:0:; s:4: ; s:5:scope; s:0:; s:5:order; s:4:1010s:11:price_group 13:renew_group; s:2:28; s:14:need_agreement; s:0:; s:13:require_other; a:1:{i:0; s: ;} s:16:prevent_if_other; N:s:4:## 13; N:s:19:autoresponder_renew; s:0:; s:16:dont_mail_expire :0:; s:13:joomla_access; s:2:36; s:10:files_path; s:108:products / Boxes8.zip | Box 8 
products / Boxes9 .zip | Box 9; s:14:download_count; s:0:; s:18:download_unlimited;}

,只有我需要更改的内容是

s:24:每个许可证一个$ 150;


解决方案

您应该可以 SELECT 该行,进行更改,然后使用新值 UPDATE




I have 2000 products with row that is using serialized data and I need to update specific string

this is the row name data

a:35:{s:11:"expire_days";s:3:"30d";s:12:"trial1_price";s:0:"";s:11:"trial1_days";s:0:"";s:12:"is_recurring";s:0:"";s:10:"start_date";s:0:"";s:5:"terms";s:24:"$150 for 1 Per license";s:12:"rebill_times";s:0:"";s:15:"paypal_currency";s:0:"";s:4:"##11";N;s:3:"url";s:0:"";s:8:"add_urls";s:0:"";s:4:"##12";N;s:5:"scope";s:0:"";s:5:"order";s:4:"1010";s:11:"price_group";s:1:"7";s:13:"renewal_group";s:2:"28";s:14:"need_agreement";s:0:"";s:13:"require_other";a:1:{i:0;s:0:"";}s:16:"prevent_if_other";N;s:4:"##13";N;s:19:"autoresponder_renew";s:0:"";s:16:"dont_mail_expire";s:0:"";s:13:"joomla_access";s:2:"36";s:10:"files_path";s:108:"products/Boxes8.zip|Box 8
products/Boxes9.zip|Box 9";s:14:"download_count";s:0:"";s:18:"download_unlimited";}

and only thing I need changed is
s:24:"$150 for 1 Per license";

any help is appreciated.

解决方案

You should probably SELECT the row, make your changes, then UPDATE with the new value. The answer to this question may be helpful if you need to do this database side.

How to do a regular expression replace in MySQL?

这篇关于如何更新已序列化数据的Mysql行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆