i have a question and hope for an answer.
now i want to retrieve some data from the database based on specific date.
So i have a table in the database called flights. this table stores the some air flights data in it.
I wrote a simple code to retrieve the flights through an interval: say i want to get the flights from day 24/11/2015 to 3/12/2015.
but the problem is when get the new month, the program crashes. i used a for loop so it keeps retrieving data forever.
how to increment date in php?
here is my code:
<?php
for($i = $date1; $i <= $date2; $i++)
{
$sql3 = "select * from flights where flight_date = '$i'";
$query3 = mysql_query($sql3);
$numrows3 = mysql_num_rows($query3);
if($numrows3 > 0)
{
// retrieve flights.
}
} // end of for loop
?>