dongzhong1929 2011-10-15 17:26
浏览 56
已采纳

使用Microsoft SQL查询反序列化PHP

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.

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.

  • 写回答

2条回答 默认 最新

  • dongshuao2309 2011-10-16 07:37
    关注

    I know this but what to use in just Microsoft SQL code is there a serial and unserialize?

    I'm fairly sure there is no direct equivalent to PHP's unserialize() in MS SQL.

    You would have to build it yourself - it would be far better to try let PHP handle it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路