Forums

meta value count (2 posts)

  1. lobos55
    Member
    Posted 2 years ago #

    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?

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Change this..

    $single = true

    to..

    true

    Does that help?

Topic Closed

This topic has been closed to new replies.

About this Topic