1 回答

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超5個(gè)贊
以下導(dǎo)致其工作。必須在聲明之前進(jìn)行連接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 關(guān)注
- 159 瀏覽
添加回答
舉報(bào)