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
my php query is as follows:
<?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);
?>
I would like to replace '2013-01-28' with yesterdays date and in that format Y-m-d. How can I do this?
Any feedback would be appreciated