以下のクエリを実行して、object_id の一意の結果を取得しようとしています。Group_concat Distinst を使用するのが最も効果的であると考えました。次のクエリの where 句で、クエリの結果を変数として使用する必要があります。
以下のクエリは flyspeedsql ソフトウェアでは正常に実行されますが、php では結果が表示されないようです。
これにアプローチするより良い方法はありますか?
wordpress get_results は使用する正しい関数ですか?
何かリンク55,56,57を返す必要があります
また、このクエリの結果から、次のクエリの where 句で使用できる変数を設定するにはどうすればよいですか?
クエリ 1
$query = ("Select
Group_Concat(Distinct $wpdb->term_relationships.object_id)
From
$wpdb->term_taxonomy Inner Join
$wpdb->term_relationships On $wpdb->term_taxonomy.term_taxonomy_id =
$wpdb->term_relationships.term_taxonomy_id Inner Join
$wpdb->terms On $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
Where
$wpdb->terms.name = 'Honda' And
$wpdb->term_taxonomy.taxonomy = 'brands'");
$results = $wpdb->get_results($query);