SELECT wposts.*, wpostmeta.*
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta, $wpdb->postmeta wpostmeta2, $wpdb->postmeta wpostmeta3
WHERE wposts.ID = wpostmeta.post_id
AND wposts.ID = wpostmeta2.post_id
AND wposts.ID = wpostmeta3.post_id
AND wpostmeta.meta_key = 'listing_subtype'
AND wpostmeta.meta_value = '$search_home_type'
AND wpostmeta2.meta_key = 'district'
AND wpostmeta2.meta_value = '$search_district'
AND wpostmeta3.meta_key = 'price_current'
AND wpostmeta3.meta_value IS >= '$search_price_min' AND <= '$search_price_max'
AND wposts.post_status = 'publish'
AND wposts.post_type = 'vreb_property'
ORDER BY wposts.post_date DESC
该行AND wpostmeta3.meta_value IS >= '$search_price_min' AND <= '$search_price_max'
试图确保meta_key的meta_value 大于 price_current
和$search_price_min
小于$search_price_max
这行不通...
[You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= '100000' AND wposts.post_status = 'publish' AND wposts.post_type = 'vreb_' at line 11]