title: $wpdb->get_results() not working
body: <p>I'm creating my own favorite posts solution, because the plugin did not work.
  So I created a new table in my WP database called wp_favorites with 2 cols user ID and post ID.
  I've already done the insertion and it works. I'm having a problem getting the data from the table. Here's the code:</p>
  
  <pre><code>function is_favorite($pid, $uid) 
  {
      global $wpdb;
  
      $q = $wpdb-&gt;prepare("SELECT * FROM wp_favorites WHERE uid=$uid AND pid=$pid;");
      echo $q;
      $res = $wpdb-&gt;get_results($q);
      var_dump($res);
      return(count($res)&gt;0);
  }
  </code></pre>
  
  <p>When I copy the output ($q) and insert it in PHPmyAdmin, it works perfectly.
  However, the output of $res is always an empty array (array(0) { } )
  I've tried without prepare, and a couple of other variations, but I can't get it to work.</p>
  
  <p>Same thing happens when I try to display the fav posts.</p>
  
  <pre><code>    &lt;?php
  /*
  Template Name: Favorites
  */
  ?&gt;
  
  &lt;?php 
  
  get_header();
  get_sidebar();
  
  global $wpdb;
  $q = "
      SELECT * FROM wp_favorites
      LEFT JOIN wp_posts ON wp_favorites.pID = wp_posts.ID
      WHERE wp_favorites.uID = 1      
  ";
  
   $pageposts = $wpdb-&gt;get_results($q, OBJECT);
  
   var_dump($pageposts);
  
  ?&gt;
  
      &lt;div id='content_and_floater'&gt;
  
          &lt;?php get_template_part('social_floater'); ?&gt;
          &lt;div id='content'&gt;
              &lt;?php get_template_part('loop'); ?&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  
  &lt;?php
  get_footer();
  ?&gt;
  </code></pre>
  
  <p>The result is, again, an empty array.
  Any ideas ?</p>