简体   繁体   中英

Get data from serialized field in Magento database

I'm trying to create a report of grouped items ordered in our Magento store, through mysql. Unfortunately, that data is stored in a serialized array in sales_flat_order_item.product_options, like this:

a:2:{s:15:"info_buyRequest";a:1:{s:20:"super_product_config";a:2:{s:12:"product_type";s:7:"grouped";s:10:"product_id";s:3:"563";}}s:20:"super_product_config";a:3:{s:12:"product_code";s:12:"product_type";s:12:"product_type";s:7:"grouped";s:10:"product_id";s:3:"563";}}

What I need is the product_id in that array. Is there an easy way to do that through mysql? I'll have to get that ID back out into the query so I can get the SKU from the product table.

您只需要反序列化

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