title: Can we use PHP function strtotime in Mysql Query
body: <p>I have the following MySQL syntax which gives me an error.</p>
  
  <p>I am aware that you cannot compare date variables directly, so I use <code>strtotime</code> to create a Unix timestamp to compare dates.</p>
  
  <p>Can you use the PHP <code>strtotime</code> function within a MySQL query?</p>
  
  <pre><code>$result = select * from table where strtotime(Date) &gt;= strtotime($_POST[DateFrom1])  
  &amp;&amp; strtotime(Date) &lt;= strtotime($_POST[DateTo1])";
  </code></pre>