title: using a php variable in the WHERE clause of a mysql query
body: <p>I'm running a very simple query that I think should work. The only thing that I haven't done before is put a php variable in the WHERE clause of the query.  The variable $X is a numerical value, say 100.  When I run this query, I just get a value of 0 returned.  Am I doing something obviously stupid?</p>
  
  <pre><code>SELECT generator_64k.n
  FROM generator_64k
  WHERE generator_64k.n&lt;= '$X'
  </code></pre>
  
  <p>I've looked around the web and also tried this:</p>
  
  <pre><code>SELECT generator_64k.n
  FROM generator_64k
  WHERE generator_64k.n&lt;= '" . $X . "'
  </code></pre>
  
  <p>But this also just returns 0.</p>
  
  <p>Any ideas?  Thanks in advance.</p>