I have a question about comparing dates set like that $date=new DateTime($_GET['date']);.
I know there is $date1->diff($date2); but this returns difference only.
This works fine when I made some tests:
$query='';
while ($date1 < $date2) {
$query='...'.$date->format("Y-m-d").'...;';
$date1->modify("+1 days");
}
$db->query($query);
My question: is that the right way of comparing 2 date objects? When I test it, results were ok, but is it possible I could get an error when script check while condition?