使用Microsoft SQL查询反序列化PHP [英] Unserialize PHP using Microsoft SQL Query
问题描述
由于我们公司使用mySQL网站和MS-SQL Accounting/ERP系统,因此我试图将数据从mySQL数据库导入Microsoft SQL.
I am trying to import data from a mySQL database into Microsoft SQL because our company uses a mySQL website and MS-SQL Accounting/ERP system.
无论如何... mySQL中的某些字段已序列化".我正在尝试确定如何使用确定的SQL代码来反序列化并将数据读入MS SQL.这可能吗?
Anyways... Some of the fields in mySQL are "serialized". I am trying to determine how using sure SQL code I could unserialize and read the data into MS SQL. Is this possible, how?
其中一个字段如下所示:
One of the fields looks like this:
a: 9: {
s: 15: "product_options";
a: 2: {
i: 719;
s: 4: "2979";
i: 718;
s: 4: "2975";
}
s: 18: "unlimited_download";
s: 1: "N";
s: 7: "product";
s: 37: "Champion Tagless Ringer Tee - T-Shirt";
s: 10: "company_id";
i: 0;
s: 6: "is_edp";
s: 1: "N";
s: 12: "edp_shipping";
s: 1: "N";
s: 10: "base_price";
d: 9.9900000000000002131628207280300557613372802734375;
s: 12: "stored_price";
s: 1: "N";
s: 21: "product_options_value";
a: 2: {
i: 0;
a: 13: {
s: 9: "option_id";
s: 3: "719";
s: 11: "option_type";
s: 1: "S";
s: 9: "inventory";
s: 1: "Y";
s: 11: "option_name";
s: 5: "Color";
s: 11: "option_text";
s: 0: "";
s: 11: "description";
s: 0: "";
s: 10: "inner_hint";
s: 0: "";
s: 17: "incorrect_message";
s: 0: "";
s: 8: "modifier";
s: 5: "0.000";
s: 13: "modifier_type";
s: 1: "A";
s: 8: "position";
s: 2: "30";
s: 12: "variant_name";
s: 13: "White/Scarlet";
s: 5: "value";
s: 4: "2979";
}
i: 1;
a: 13: {
s: 9: "option_id";
s: 3: "718";
s: 11: "option_type";
s: 1: "S";
s: 9: "inventory";
s: 1: "Y";
s: 11: "option_name";
s: 13: "Clothing Size";
s: 11: "option_text";
s: 0: "";
s: 11: "description";
s: 0: "";
s: 10: "inner_hint";
s: 0: "";
s: 17: "incorrect_message";
s: 0: "";
s: 8: "modifier";
s: 5: "0.000";
s: 13: "modifier_type";
s: 1: "A";
s: 8: "position";
s: 2: "20";
s: 12: "variant_name";
s: 6: "Medium";
s: 5: "value";
s: 4: "2975";
}
}
}
在此先感谢您提供任何帮助.
Thank you in advance for any assistance anyone can provide on this.
推荐答案
我知道这一点,但是仅在Microsoft SQL代码中使用的是序列化和反序列化的吗?
I know this but what to use in just Microsoft SQL code is there a serial and unserialize?
我很确定在MS SQL中没有直接等价于PHP的unserialize()
.
I'm fairly sure there is no direct equivalent to PHP's unserialize()
in MS SQL.
您必须自己构建它-尝试让PHP处理它会更好.
You would have to build it yourself - it would be far better to try let PHP handle it.
这篇关于使用Microsoft SQL查询反序列化PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!