title: get a date from a mysql query in php
body: <p>I have a mysql database.
  I have a php script, that connects to my database. My database consists of 3 tables, error, date, email address, as per the screenshot</p>
  
  <p><img src="https://i.stack.imgur.com/l6pIb.png" alt="Database structure"></p>
  
  <p>my php query is as follows:</p>
  
  <pre><code>&lt;?php
  
  mysql_connect("localhost", "username", "password") or die(mysql_error());
  mysql_select_db("pmta_reporting") or die(mysql_error());
  
  $result = mysql_query("SELECT * FROM microcompany WHERE date='2013-01-28' AND code='2.0.0'") or die(mysql_error());
  $count= mysql_num_rows($result);
  echo $count;
  
  mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p>I would like to replace '2013-01-28' with yesterdays date and in that format Y-m-d.
  How can I do this?</p>
  
  <p>Any feedback would be appreciated</p>