I am using php with MySQL and trying to figure out how to select data created within the last 3 days.
My date is formatted in the database like 09-20-01
Here is what I have been trying to use, but I'm not too sure on how to subtract 3 days from $date1.
$date1 = date("m-d-y");
$date2 = $date1 - 3;
$query = "select * from My_Table WHERE date BETWEEN $date1 AND $date2
What am I doing wrong?