Let's say you have a dropdown box and a database. My data base consists of airport data as follows:
terminal | origin | airline | flight | scheduledDate | scheduledTime | status
t1 dubai cityjet WX113 2016-11-17 11:45 due 11:47
t2 frankfurt ryanair FR6874 2016-11-17 11:50 due 12:00
t1 ....
So I have my HTML written up and I need to make a dropdown menu using PHP and in that I have to count all flights recorded by terminal, and then by each terminal t1 and t2. I checked my figures and by using
SELECT COUNT(terminal) FROM arrivals;
select count(terminal) from arrivals where terminal='t1';
select count(terminal) from arrivals where terminal='t2';
which gives me a total of
Total Flights | 7492
Terminal 1 | 4167
Terminal 2 | 3325
But I need to take this data and put it into my HTML using PHP and create a dropdown menu displaying total as above and then the dropdown menu allows me to find total flights for each month
<!--dropdown menu -->
Arrival Stats for Month: | <ALL> | Find
Total Flights | 7492
Terminal 1 | 4167
Terminal 2 | 3325
By using the dropdown menu for December Results I get
Arrival Stats for Month: | December | Find
Total Flights | 897
Terminal 1 | 471
Terminal 2 | 426
I'm just so confused by the entire thing, do I need to put in individual option values in the form
<option value="All">ALL</option>
<option value="id1">JAN</option>
<option value="id2">FEB</option>
<option value="id3">MAR</option>
and then using the id's do I create variables and turn them into querys and echo the results into the table?
Sorry for the long post, just been staring at this the last two days and getting no where with it