title: sql IN clause only returning the current row, instead of selected ones
body: <p>I'm developing a site which is supposed to return similar movies by comparing the metadata from the movie that is selected, with the metadata from the ones in the database.</p>
  
  <p>At the moment, I'm just comparing the <em>classification rating</em>. For example, if you've selected a movie that has a rating of <em><strong>R</strong></em> or <em><strong>MA</strong></em>, then the results returned should be something with a similar classification (ie: <em><strong>M</strong></em>, <em><strong>MA</strong></em> or <em><strong>R</strong></em>).</p>
  
  <p>So far, this is what my <strong>SQL</strong> and <strong>PHP</strong> look like.</p>
  
  <pre><code>$rating = $data-&gt;rating;
  if($rating === "MA" || $rating === "R"){
      $rating = "M, MA, R";
  }
  
  $rating = "rating IN (" . $rating . ")";
  $sql = "SELECT * FROM movies WHERE unique_id &lt;&gt; ? AND " . $rating . " LIMIT 10";
  </code></pre>
  
  <p>If the <strong>SQL</strong> is output to the page, it should look like <code>SELECT * ... AND rating IN (M, MA, R) ...</code>, which it does. However, instead of the returned results being of all those movies that have a rating of <em><strong>M</strong></em>, <em><strong>MA</strong></em> or <em><strong>R</strong></em> (not including the selected movie), it will return only the selected movie.</p>
  
  <p>Here's an <strong>example</strong> of my current database table:</p>
  
  <pre><code>+----+--------+--------+-----------+
  | id | title  | rating | unique_id |
  +----+--------+--------+-----------+
  |  1 | movieA | R      | idA       |
  |  2 | movieB | MA     | idB       |
  |  3 | movieC | M      | idC       |
  |  4 | movieD | MA     | idD       |
  |  5 | movieE | PG     | idE       |
  +----+--------+--------+-----------+
  </code></pre>
  
  <p>For <code>movieA</code>, it should be returning all movies apart from <code>movieE</code>. If it was <code>movieC</code>, it should be returning <code>2, 4 and 5</code>.</p>
  
  <p>I feel like I have used the <code>IN</code> clause correctly, so I'm confused as to why this is not working. </p>
  
  <p>All help is appreciated, Cheers.</p>