title: Retrieving today date data from mysql using pdo
body: <p>I have some data in my table which are <code>[name][address][phone_number]</code> and the date in this format <code>2015-10-14 14:37:38</code>. I am using php PDO. How can I query out just today date from the table?</p>
  
  <p>The following code is my code to query out result for the past 7 days which worked perfectly. However, whenever I replace it with 1 it doesn't work:</p>
  
  <pre><code>$query = $digital-&gt;query('SELECT * FROM sales WHERE `datetime` BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW() ORDER BY sale_id DESC'); 
  </code></pre>
  
  <p>What I want is to be able to query out all today data inserted into database.</p>