title: mysql IN Clause not accepting string variable
body: <p>I have this odd problem with an IN clause</p>
  
  <p>The variable $fuel comes from an Ajax call to this php page.</p>
  
  <pre><code>$fuel = $_REQUEST['fuel'];
  
  var_dump($fuel) = 'gas' ( for instance)
  </code></pre>
  
  <p>Now, when $fuel is not selected in the php page that originates the Ajax call, I need to insert ALL possibles values for $fuel, with the following code:</p>
  
  <pre><code> if($fuel=='none'){
      $fuel=array('gas','diesel','hybrid','electric');
      $fuel=implode(',',$fuel);
  } 
  </code></pre>
  
  <p>This is the query. It works fine when the value comes directly from the Ajax call, that is, when $fuel = 'gas', for instance.</p>
  
  <p>But it gives me an empty set when $fuel is generated by my IF clause and is $fuel = 'gas,diesel,hybrid,electric'.</p>
  
  <pre><code>SELECT * FROM vprice_range WHERE (power &gt;= $power)
              AND (price BETWEEN $low AND $high)
              AND (fuel IN ('$fuel'))
              AND (mileagemix &lt; $mileage)
              AND (emission_co2 &lt; $co2)
              AND (trunk &gt;= $trunk)
  </code></pre>
  
  <p>This may be irrelevant, but note that the FIELD 'fuel' is a ENUM field ('gas','diesel','hybrid','electric')</p>
  
  <p>As far as I know $fuel is formatted correctly as a string.</p>
  
  <p>Please advise</p>