1 回答
TA贡献1811条经验 获得超5个赞
以下导致其工作。必须在声明之前进行连接WHERE。
//query for pulling in shipping data
function prntPage($submittedZip) {
global $wpdb;
// The SQL query
if($submittedZip) {
$results = $wpdb-> get_results("SELECT {$wpdb->prefix}woocommerce_shipping_zones.zone_name ".
"FROM {$wpdb->prefix}woocommerce_shipping_zone_locations ".
"INNER JOIN {$wpdb->prefix}woocommerce_shipping_zones ".
"ON {$wpdb->prefix}woocommerce_shipping_zone_locations.zone_id = {$wpdb->prefix}woocommerce_shipping_zones.zone_id ".
"WHERE location_code = '$submittedZip' ");
// Loop though rows data
foreach( $results as $row ){
print_r($row);
//debug_to_console($row);
}
}
}
- 1 回答
- 0 关注
- 86 浏览
添加回答
举报