I have a database containing purchasers’ information. I now need to generate a report by comparing user start and end dates with order_date in the MySQL database using PHP. For example: The user needs purchase info between July 1 ($start_date) and July 11 ($end_date).
My code:
$result = mysql_query("SELECT * FROM internet_sales WHERE order_date BETWEEN '$start_date' AND '$end_date' ORDER BY order_date ASC ") or die(mysql_error());
My results:
Range of dates: Jul 1 2014 - Jul 11 2014July Monthly Internet Sales Report
Order Date Purchaser Charge ($)
1 Jul 1, 2014 12:16:45 EDT xxxx xxxxxx 28.90
2 Jul 10, 2014 11:35:49 EDT xxxx xxxxxx 13.99
3 Jul 10, 2014 09:25:49 EDT xxxx xxxxxx 74.96
4 Jul 11, 2014 10:45:44 EDT xxxx xxxxxx 12.99Total 130.84</blockquote>
I’m missing July 2, 3, 4, 7, and 9. What do I need to do to include all dates and have output listed as:
July 1, July 2, July 3,… , July 11?