I have a table showing flights. The dataset is automatically imported so I would prefer not altering data in the database.
The set has a start and end date for a flight. The columns are called "start" and "end", and contains for example the start date "4-Nov-15" and end date "17-Dec-15".
How can I build a query to check if a row is within these two timeframes?
$currenttime = time();
mysql_select_db("wifva");
$result = mysql_query("SELECT * FROM flights WHERE start <= '$currenttime' && end >= '$currenttime' ORDER BY deptime");
while($row = mysql_fetch_array($result))
{
?>
<tr class="hover" style="text-align: left;">
<td class="border_bottom"><?php echo $row['deptime'];?>z</td>
<td class="border_bottom"><?php echo $row['callsign'];?></td>
The above code does show data in my table, but doesn't output the correct information (assuming that php/sql doesn't automatically recognize date format etc).
Any help is appreciated.