Ok so here is my dilemma. I have an event system and I am trying to come up with some php to accomplish a specific style of output. To begin, I have a database that contains 3 tables:
1. The first table (events) contains the events and their data. It consists of: eventID, eventTitle, eventDateTime, and eventDescRaw. There are a few more fields but I don't need them for this.
2. The second table (events_categories) contains: categoryID and categoryTitle. This table essentially gives an ID we can work with to the different event categories.
3. The third table (events_to_categories) contains: eventID and categoryID. This table just links the events to the categories they belong to. One event can belong to multiple categories (leading to multiple rows in this table with the same eventID).
What I am trying to achieve is this:
I would like to query the database and pull all events (from today's date on) and output as such:
So essentially I'm outputting as
Month - Days - Events
Month - Days - Events
in unordered lists. I'm not repeating the string "April" for each event. Let alone the day for each event if multiple events occur on the same day.
I've uploaded a screenshot of what I'm talking about, but this example only has the info for one month. Imagine the month of May and it's events listed under it as well. (http://cl.ly/60hc)
The reason I included the information about the categories is because it would be nice if I could specify which categories I want included. My main purpose is to include all categories, but it would be nice to be able to output in a similar style for one specific category in another area of the website.
I hope this makes sense... and now I turn to the experts here to help me figure this out as I can't quite seem to wrap my head around this one.
Thanks in advance!
Brendon
1. The first table (events) contains the events and their data. It consists of: eventID, eventTitle, eventDateTime, and eventDescRaw. There are a few more fields but I don't need them for this.
2. The second table (events_categories) contains: categoryID and categoryTitle. This table essentially gives an ID we can work with to the different event categories.
3. The third table (events_to_categories) contains: eventID and categoryID. This table just links the events to the categories they belong to. One event can belong to multiple categories (leading to multiple rows in this table with the same eventID).
What I am trying to achieve is this:
I would like to query the database and pull all events (from today's date on) and output as such:
Code:
<ul>
<li>
First Month (ie April)
<ul>
<li>
Day of the month
<ul>
<li>Event title and description (first event on this date)</li>
<li>Another event on the same day, etc</li>
</ul>
</li>
<li>
Another day of the month
<ul>
<li>Event title and description (only one event is on this date</li>
</ul>
</li>
</ul>
</li>
<li>
Start the process all over again with the second month (ie May)
</li>
</ul>
So essentially I'm outputting as
Month - Days - Events
Month - Days - Events
in unordered lists. I'm not repeating the string "April" for each event. Let alone the day for each event if multiple events occur on the same day.
I've uploaded a screenshot of what I'm talking about, but this example only has the info for one month. Imagine the month of May and it's events listed under it as well. (http://cl.ly/60hc)
The reason I included the information about the categories is because it would be nice if I could specify which categories I want included. My main purpose is to include all categories, but it would be nice to be able to output in a similar style for one specific category in another area of the website.
I hope this makes sense... and now I turn to the experts here to help me figure this out as I can't quite seem to wrap my head around this one.
Brendon