title: php how to refer to variable in a ORDER BY FIELD()
body: <p>I need to dynamically order a table using a variable.</p>
  
  <p>A var_dump of an instance of the variable $vid is:</p>
  
  <pre><code>string(9) "15,251,21"
  </code></pre>
  
  <p>And this is an example of the query:</p>
  
  <pre><code>$sql=mysql_query("SELECT * FROM vcomp ORDER BY FIELD(version_id,$vid)");
  </code></pre>
  
  <p>It does work if I place the hard numbers, like:</p>
  
  <pre><code>    $sql=mysql_query("SELECT * FROM vcomp ORDER BY FIELD(version_id,15, 251, 21)");
  </code></pre>
  
  <p>I tried quotes, backtick and the like without success.
  Thanks </p>