My query with posts and custom taxonomies wont work
-
Hello,
Can anyone tell me why i get this error (Unknown column ‘wposts.ID’ in ‘on clause’) on the below query? I have tried with prefix also.
SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta, $wpdb->postmeta wpostmeta2 INNER JOIN $wpdb->term_relationships ON(wposts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) JOIN $wpdb->postmeta ON(wposts.ID = $wpdb->postmeta.post_id) WHERE $wpdb->term_taxonomy.term_id = '$_POST[cp_auction_category]' AND $wpdb->term_taxonomy.taxonomy = 'auctions' AND wposts.ID = wpostmeta.post_id AND wposts.ID = wpostmeta2.post_id AND (wpostmeta.meta_key = 'closed' AND wpostmeta.meta_value = '0') AND (wpostmeta2.meta_key = 'featured' AND wpostmeta2.meta_value >= '0') AND wposts.post_status = 'publish' ORDER BY wpostmeta2.meta_value AND wposts.post_date DESC";
Thanks
Rune
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘My query with posts and custom taxonomies wont work’ is closed to new replies.