title: Compare mysql datetime field with php date(Ymd)
body: <p>MySQL DATE_FORMAT returns null value</p>
  
  <pre><code>SELECT DATE_FORMAT(  'stmt_for',  '%Y%m%d' ) FROM  `edu_daily_statements` ;
  </code></pre>
  
  <p>When I run this query MySQL returns null value. The value stored in stmt_for field is <code>2011-12-06 00:33:40</code>.</p>
  
  <p>What is the problem?</p>
  
  <pre><code>WHERE DATE_FORMAT(  'stmt_for',  '%Y%m%d' ) = date('Ymd')
  </code></pre>
  
  <p>I need this condition in MySQL query.
  Is there any other ways to compare MySQL datetime field <code>Ymd</code> with PHP <code>Ymd</code>?</p>