title: MySQL code fails to display category name (WordPress database)
body: <p>Why does this code fail to display the category name "Apples" using the current WordPress taxonomy system? The Category names are stored in the $wpdb->terms table (wp_terms). </p>
  
  <pre><code>&lt;?php
  
  $ra_category_id = 3; 
  $ra_category = $wpdb-&gt;get_results("SELECT name FROM $wpdb-&gt;terms WHERE term_id = '3'");
  $ra_category_name = $ra_category-&gt;name;         
  
  ?&gt;
  
  &lt;h3&gt;Category: &lt;?php echo $ra_category_name; ?&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>The table rows are      </p>
  
  <pre><code>term_id     name              slug          term_group
  1         Uncategorized     uncategorized   0
  2         Blogroll          blogroll        0
  3         Apples            apples          0
  4         Bananas           bananas         0
  </code></pre>