Title: executing a query in plugin
Last modified: September 1, 2016

---

# executing a query in plugin

 *  [Prateek](https://wordpress.org/support/users/kaltime/)
 * (@kaltime)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/executing-a-query-in-plugin/)
 * Hi Guys
 * I need help in modifing this query in wp plugin please advice
 * first the query
 * $common_args = array(
    ‘post_type’ => ‘product’, ‘posts_per_page’ => $wpcs_total_products,‘
   post_status’ => ‘publish’, ‘meta_key’ => ‘location_name’, ‘meta_value’ => $country
 * right now this work fine with a little change i want to do i want single product
   from each category
 * for example
 * Product ID | Category ID |
    1 | 1 2 | 1 3 | 1 4|2 5|2 6|3 7|4 8|4
 * so output of query would be
 * Product ID -> 1,4,6,7
 * thanks in advance

The topic ‘executing a query in plugin’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Prateek](https://wordpress.org/support/users/kaltime/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/executing-a-query-in-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
