What’s wrong with this wpdb query?
Try this, it worked for me: global $wpdb; $terms = $wpdb->get_col( $wpdb->prepare( “SELECT name FROM {$wpdb->terms} WHERE term_group = %d ORDER BY name ASC”, primary_tag_id )); What you are after is $wpdb->terms not $wpdb->wp_terms