title: MySQL list IN list
body: <p>I currently store user's inputs in comma separated lists like so:</p>
  
  <pre><code>Userid | Options
  1      |  1,2,5
  </code></pre>
  
  <p>A user ticks a set of options in a form which is an array, which is then joined with a comma to make</p>
  
  <pre><code>1,2,5
  </code></pre>
  
  <p>Then MySQL is trying to find other users who some or all of the same options ticked on a different field name (although same table).</p>
  
  <p>Currently I do this:</p>
  
  <pre><code>WHERE `choices` IN ('.$row['myoptions'].')
  </code></pre>
  
  <p>So this could be something like:</p>
  
  <pre><code>WHERE 1,2,5,8 IN (1,4,6)
  </code></pre>
  
  <p>This would return true because theres at least one value match right? Or have i got this confused..</p>