title: SELECTING WHERE from array in a mysql query
body: <p>I'm trying to SELECT from an array inside a mysql query </p>
  
  <pre><code>result = mysql_query("
  SELECT * FROM fruit_db
  WHERE fruit='".$url."'
  ")
  </code></pre>
  
  <p>$url has been created by $_GET and exploded into an array. It can be 'apple' or 'apple,banana,orange' for example. Not sure whether to implode back into string or not.</p>
  
  <p>I need to be selecting 'apple' OR 'banana' OR 'orange', not 'apple,banana,orange'.</p>
  
  <p>I'm used to counting the elements of the string, and looping through them, but not inside a mysql query, I can't work out if there's a simple way.
  I've tried something like</p>
  
  <pre><code>/*    
      result = mysql_query("
      SELECT * FROM fruit_db
      WHERE fruit='".$url[0]."'
      OR  fruit='".$url[1]."'
      // etc
      ")
  */
  </code></pre>
  
  <p>but I don't know how many elements there will be</p>