如何从序列化数据n mysql中搜索值?

时间:2012-08-10 17:27:40

标签: mysql sql

我想在此表中搜索以序列化形式存储的数据。

表格结构

enter image description here

对于

meta_key - mgm_member_options

meta_value -

一个:31:{S:2: “ID”,S:1: “1”; S:13: “custom_fields”;一个:6:{S:10: “如first_name”; S:5:”系统管理员 “; S:9:” 姓氏 “; S:5:” 罗勒 “; S:7:” 地址 “; S:0:” “; S:4:” 城市 “; S:0:”“; S :5: “状态”; S:0: “”,S:3: “拉链”; S:0: “”;} S:22: “other_membership_types”;一个:0:{} S:12:“payment_info “;一个:0:{} S:6:” 优惠券 “;一个:0:{} S:7:” 升级 “;一个:0:{} S:6:” 扩展“;一个:0:{} s:4:“code”; s:10:“mgm_member”; s:4:“name”; s:10:“Member Lib”; s:11:“description”; s:10:“Member Lib”; S:7: “设置”;一个:0:{} S:6: “保存”; S:1: “1”; S:8: “trial_on”; S:1: “0”; S:10: “trial_cost”; S:1: “0”; S:14: “trial_duration”; S:1: “0”; S:19: “trial_duration_type”; S:1: “d”; S:16:“trial_num_cycles “; S:1:” 0 “; S:8:” 持续时间 “; S:1:” 0 “; S:13:” duration_type “; S:1:” M “; S:6:” 量“; S:1: “0”; S:8: “货币”,S:3: “USD”; S:9: “join_date”; S:0: “”,S:13: “last_pay_date”; S:0 : “”,S:11: “EXPIRE_DATE”; S:0: “”,S:15: “membership_type”; S:5: “客人”; S:6: “状态”; S:8: “无效” ; S:12: “payment_type”; S:0: “”,S:13: “自动应答”; S:0: “”,S:10: “订阅”; S:0: “”; S:9: “rss_token”; S:32: “af8214c978dedcaa066bd8c223b7d22d”; S:13: “USER_PASSWORD”; S:16:“m9ROVxRwfxW wJzti“;}

我想找到邮政编码。 怎么用sql查询呢?

查询我正在使用

  

if(isset($ _ GET ['as_zip'])&&!empty($ _ GET ['as_zip'])){                     $ as_zip = $ _GET ['as_zip'];
                    array_push($ meta_query_array,array('key'=>'mgm_member_options','value'=> $ as_zip,'compare'=>'='));                 } //准备参数$ args = array('role'=> $ role,'number'=>'10','orderby'=>'display_name','fields'=>   'all_with_meta','meta_query'=> $ meta_query_array);

0 个答案:

没有答案