Title: Meta_Query Issue
Last modified: August 20, 2016

---

# Meta_Query Issue

 *  [bgajus](https://wordpress.org/support/users/bgajus/)
 * (@bgajus)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/meta_query-issue-1/)
 * Having issues with a query where I’m using meta_query to filter the results. 
   The problem I’m having is when the key values are hard-coded the results work
   perfectly. When I try to use a php variable in it’s place I get nothing. I’ve
   gone through and made sure that the value of the variable is the same as what
   was hard-coded. I’ll completely stumped. Any ideas?
 *     ```
       query_posts(array(
       			'post_type' => 'issues',
       			'ki_systems' => $getSystems,
       			'orderby' => 'modified',
       			'paged' => $paged,
       			'posts_per_page' => '30',
       			'meta_query' => array(
       			  'relation' => 'OR',
       				array(
       					'key' => 'status',
       					'value' => $workaround,
       					'compare' => '=='
       					),
       				array(
       					'key' => 'status',
       					'value' => $resolved,
       					'compare' => '==',
       					),
       				array(
       					'key' => 'status',
       					'value' => $unresolved,
       					'compare' => '=='
       					)
       					)
       					)
       					);
       ```
   

The topic ‘Meta_Query Issue’ is closed to new replies.

## Tags

 * [meta_query](https://wordpress.org/support/topic-tag/meta_query/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [bgajus](https://wordpress.org/support/users/bgajus/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/meta_query-issue-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
