Each record in my mysql event database can have as many as seven dates and corresponding times in it.
Record Format: Event Location, Event Type, Date1, Date2, Date3, Date4, Date5, Date6, Date7
Record #1: Joe's,Barbecue,3/1/04 - 5:00 pm,3/2/04 - 8:00 pm,3/3/04 - 2:00 pm, 3/4/04 - 4:00 pm,3/5/04 - 1:00 pm,3/6/04 - 4:00 pm,3/7/04 - 9:00 pm
Record #2: Rob's,Party,3/1/04 - 5:00 pm,3/2/04 - 8:00 pm,3/3/04 - 2:00 pm, 3/4/04 - 4:00 pm,3/5/04 - 1:00 pm,3/6/04 - 4:00 pm,3/7/04 - 9:00 pm
Record #3: Brad's,Barbecue,2/29/04 - 3:00 pm, 3/1/04 - 8:00 pm,3/2/04 - 2:00 pm, 3/3/04 - 8:00 pm,3/4/04 - 11:00 am, 3/5/04 - 2:00 pm,3/6/04 - 7:30 pm
When I run my php program to pull events within, for example, a five day date range (e.g. 2/26/04 through 3/1/04) each record is examined seven times for each day in my date range. After the first date field in each of the records is examined, the records for that day in the date range are printed out. The results are ordered by Event Type within a date in the date range. The three sample records above would yield:
02/26/04 - No Records
02/27/04 - No Records
02/28/04 - No Records
02/29/04:
Barbecue , Brad's, 3:00 pm
03/01/04:
Barbecue, Joe's, 5:00 pm;
Party, Rob's, 5:00 pm;
Barbecue, Brad's, 8:00 pm
If the 3/1/04 date for Brad's Barbecue were in the first date field of the record, then the results for 03/01/04 would show:
Barbecue, Joe's, 5:00 pm;
Barbecue, Brad's, 8:00 pm;
Party, Rob's, 5:00 pm
Because the 3/1/04 date is in the second date field of Brad's record, it is printed out after Rob's party. Is there a way for me to temporarily store all the records pulled from the database for a particular date in the date range, and then print them out after sorting them by event type.