title: How to select date range in mysql?
body: <p>i want to select a date range in mysql.</p>
  
  <pre><code>$dateFrom='2016-01-01';
  $dateTo='2016-01-02';
  </code></pre>
  
  <p>NOT WORKING</p>
  
  <pre><code>query ="SELECT ".$name.",timestamp FROM people where age=".$age." AND timestamp&gt;=".$dateFrom." AND timestamp&lt;.$dateTo";
  </code></pre>
  
  <p>WORKING</p>
  
  <pre><code>query ="SELECT ".$name.",timestamp FROM people where age=".$age." AND timestamp&gt;='2016-01-01' AND timestamp&lt;'2016-01-02';
  </code></pre>