I have this code, where I want to get inclusive dates between two dates. Date1 is the date to day and Date2 is the date after 7 days. I am having problem because the code returns date from the past day, How should I fix it? This is my query.
$date = date('Y-m-d'); //current date
$date1 = strtotime("+7 day"); //7 days from now
$date2 = date('Y-m-d', $date1);
$result = mysqli_query($connection,"SELECT os_no, total, balance, discount, date_order, date_pickup, time_pickup
FROM order_customer
WHERE Date(date_pickup) between '$date' AND '$date2'
");
The code returns this:
My date_pick up is of TIMESTAMP type. Thanks in advance.