Support » Fixing WordPress » Problems with $wpdb

  • Matt

    (@intellivision)


    <?php $numvrd = $wpdb->query("SELECT SUM(wp_term_taxonomy.count) FROM wp_term_taxonomy where wp_term_taxonomy.term_id in (73,74)"); echo($numvrd); ?>

    Running that query in a MySql query editor returns 425.

    The code above – in a WP footer – returns 1.

    It’s exactly the same in both. Any ideas?

Viewing 1 replies (of 1 total)
  • Matt

    (@intellivision)

    Ack, I was using $wpdb incorrectly. I did the above, but instead of $wpdb->query I used $wpdb->get_var and it returns 425.

Viewing 1 replies (of 1 total)
  • The topic ‘Problems with $wpdb’ is closed to new replies.