Hi
I need help with the ordering of records by specific fields within those records.
I have a table of Flights for a passenger booking. Amongst other fields the important fields of each record would be:
BookingID
PassengerID
OutboundFlightDate
OutboundFlightTime
OutboundFlightNumber
Now each passenger on a booking can have multiple flights, some on the same day some on different days. What I need to do is find a way to pull out all the flights for a passenger and display them in order of:
1) OutboundFlightDate
2) OutboundFlightTime
Therefore if two or more flights for a passenger have the same OutboundFlightDate, it resorts to using the OutboundFlightTime as the primary display order value. The OutboundFlightDate is always the primary order value to begin with.
I assume I need to SELECT all of this information from the database first (as there could be many rows of data for a single passenger) and store it into an array and then somehow output the array contents into my HTML page in the required order.
Can anyone offer any advice or sample code on how I can achieve this fuictionality?
Unfortunately I cannot change the database structure.
Thanks in advance.