Title: meta value count
Last modified: August 19, 2016

---

# meta value count

 *  [lobos55](https://wordpress.org/support/users/lobos55/)
 * (@lobos55)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/meta-value-count/)
 * Hi,
    I have the following query:
 *     ```
       $journal = get_post_meta($post_id, 'Journal', $single = true);
       $journal_count = $wpdb->get_var("SELECT COUNT (*)
       	FROM $wpdb->postmeta WHERE meta_key = 'Journal' AND meta_value = '$journal' " );
       ```
   
 * this returns NULL.
 * I don’t understand why.
 * Anybody help?

Viewing 1 replies (of 1 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/meta-value-count/#post-1186427)
 * Change this..
 *     ```
       $single = true
       ```
   
 * to..
 *     ```
       true
       ```
   
 * Does that help?

Viewing 1 replies (of 1 total)

The topic ‘meta value count’ is closed to new replies.

## Tags

 * [count](https://wordpress.org/support/topic-tag/count/)
 * [meta value](https://wordpress.org/support/topic-tag/meta-value/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/meta-value-count/#post-1186427)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
