Which query method to use? (edit- wpdb syntax problems)
This will work fine. global $wpdb; $querydetails = ” SELECT wposts.* FROM $wpdb->posts AS wposts INNER JOIN $wpdb->postmeta AS wpostmeta ON wposts.ID = wpostmeta.post_id WHERE wposts.post_status=”publish” AND wposts.post_type=”match_report” AND wpostmeta.meta_key = ‘report_home-select’ AND wpostmeta.meta_value=”198″ “; $teaminfo = $wpdb->get_results($querydetails, OBJECT); Try it.