title: Why does $wpdb->prepare() not pass my query?
body: <p>Hopefully a quick Wordpress one;</p>
  
  <p>I'm running a db query on a single.php page using the $wpdb class.</p>
  
  <p>My query keeps getting deleted by $wpdb->prepare. It looks like this;</p>
  
  <pre><code>$query = $wpdb-&gt;prepare("SELECT post_title, guid
           FROM $wpdb-&gt;posts
           WHERE ID IN(" . implode(', ', array_fill(0, count($selected_products),
           '%d')) . ") AND post_status = %s", $selected_products, 'publish');
  </code></pre>
  
  <p>Sorry about the crazy indentation!</p>
  
  <p>If I run this through SQL in PHPMyAdmin it works fine. Any pointers?</p>