我想在此表中搜索以序列化形式存储的数据。
表结构
为了
meta_key - mgm_member_options
元值 -
a:31:{s:2:"id";s:1:"1";s:13:"custom_fields";a:6:{s:10:"first_name";s:5:"Admin"; s:9:"姓氏";s:5:"Basil";s:7:"地址";s:0:"";s:4:"城市";s:0:"";s:5: "状态";s:0:"";s:3:"zip";s:0:"";}s:22:"other_membership_types";a:0:{}s:12:"payment_info";a :0:{}s:6:"优惠券";a:0:{}s:7:"升级";a:0:{}s:6:"扩展";a:0:{}s:4 :"code";s:10:"mgm_member";s:4:"name";s:10:"会员库";s:11:"描述";s:10:"会员库";s:7 :"setting";a:0:{}s:6:"saving";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:"duration";s:1:"0" ;s:13:"duration_type";s:1:"m";s:6:"amount";s:1:"0";s:8:"currency";s:3:"USD";s :9:"加入日期";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:" m9ROVxRwfxWwJzti";}s:1:"d";s:16:"trial_num_cycles";s:1:"0";s:8:"duration";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:"guest";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:"m9ROVxRwfxWwJzti";}s:1:"d";s:16:"trial_num_cycles";s:1:"0";s:8:"duration";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:"guest";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:"m9ROVxRwfxWwJzti";}持续时间";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:"guest";s:6:"status";s:8:"Inactive";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:"m9ROVxRwfxWwJzti";}持续时间";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:"guest";s:6:"status";s:8:"Inactive";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:"m9ROVxRwfxWwJzti";}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:"m9ROVxRwfxWwJzti";}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:"m9ROVxRwfxWwJzti";}已订阅";s:0:"";s:9:"rss_token";s:32:"af8214c978dedcaa066bd8c223b7d22d";s:13:"user_password";s:16:"m9ROVxRwfxWwJzti";}已订阅";s:0:"";s:9:"rss_token";s:32:"af8214c978dedcaa066bd8c223b7d22d";s:13:"user_password";s:16:"m9ROVxRwfxWwJzti";}
我想查找邮政编码。如何使用 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 );