将我的 sql 字段中的数据序列化为文本

发布于 2024-10-25 16:41:44 字数 1041 浏览 6 评论 0原文

我有在 mysql 字段的文本类型中序列化的订单详细信息。最近,一位客户添加了一笔大订单,其中文本类型字段无法处理。所以现在我想将 TEXT 更改为 LONGTEXT。字段类型的更改会对现有输入的数据(篮子)产生任何影响吗?

我有一长串序列化的篮子,最后的物品丢失了。我仍然可以使其至少恢复到输入的那些项目吗?我知道处理序列化数据有点困难。但还是很好奇是否有什么办法可以让这个篮子(订单)恢复?

序列化数据是这样的。它是购物篮中一件商品的样品。

O:6:"basket":1:{s:8:"order_id";b:0;s:8:"contents";a:1:{i:2375;a:2:{s:7:"details";a:21:{s:10:"product_id";s:4:"2375";s:11:"category_id";s:2:"68";s:10:"stock_code";s:5:"80200";s:4:"name";s:8:"Angelica";s:11:"description";s:1474:" ";s:8:"complete";s:1:"0";s:7:"display";s:1:"1";s:10:"meta_title";s:69:".";s:14:"botanical_name";s:21:"Angelica archangelica";s:6:"height";s:10:"2.5m (8ft)";s:6:"spread";s:10:"1.5m (5ft)";s:5:"scent";s:7:"neither";s:8:"position";s:7:"not_set";s:12:"availability";s:3:"NOW";s:8:"climbing";s:2:"on";s:7:"borders";s:2:"on";s:10:"containers";s:2:"on";s:7:"rhs_agm";s:0:"";s:10:"greenhouse";s:2:"on";s:7:"vegplot";s:2:"on";}s:7:"options";a:1:{i:3358;a:4:{s:8:"quantity";d:1;s:4:"unit";s:8:"Per pack";s:5:"value";s:4:"1.45";s:8:"adjusted";b:0;}}}}}

I have orders details as serialized in the TEXT Type of mysql field. Recently one of customer add a big order which a TEXT type field was unable to process. So Now I want to change the TEXT to LONGTEXT. Would change of FIELD TYPE have any effect to existing entered data(baskets)??

I have a a long serialized string of Basket with last items missing. Can I still make it recover to at least with those items which are entered. I know its kind of difficult to play with serialized data. but still curious if there will be any way to make that basket (orders) recover?

serialized data is something like this. it is sample for one item in basket.

O:6:"basket":1:{s:8:"order_id";b:0;s:8:"contents";a:1:{i:2375;a:2:{s:7:"details";a:21:{s:10:"product_id";s:4:"2375";s:11:"category_id";s:2:"68";s:10:"stock_code";s:5:"80200";s:4:"name";s:8:"Angelica";s:11:"description";s:1474:" ";s:8:"complete";s:1:"0";s:7:"display";s:1:"1";s:10:"meta_title";s:69:".";s:14:"botanical_name";s:21:"Angelica archangelica";s:6:"height";s:10:"2.5m (8ft)";s:6:"spread";s:10:"1.5m (5ft)";s:5:"scent";s:7:"neither";s:8:"position";s:7:"not_set";s:12:"availability";s:3:"NOW";s:8:"climbing";s:2:"on";s:7:"borders";s:2:"on";s:10:"containers";s:2:"on";s:7:"rhs_agm";s:0:"";s:10:"greenhouse";s:2:"on";s:7:"vegplot";s:2:"on";}s:7:"options";a:1:{i:3358;a:4:{s:8:"quantity";d:1;s:4:"unit";s:8:"Per pack";s:5:"value";s:4:"1.45";s:8:"adjusted";b:0;}}}}}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等你爱我 2024-11-01 16:41:44

无法恢复该数据,您可以将 text 更改为 longtext 这不会影响现有数据,但无法恢复最近丢失的行。

It is impossible to recover that data you can change text to longtext this will not impact existing data but can not recover your recent missing row.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文