Efficent Calendar Code to Extract Date Based Events & Display as Columned Calendar
Posted on 2006-12-01
I've been considering trying to build something like this for about 12 months but when running over it in my head, I can never work out an efficient way of doing this.
I want to know the best way to extract all of the events for a given month from a database and display then in a HTML formatted calendar. I have the code sorted to generate a calendar both in PHP and Vbscript (as the code produced by the ASP.NET Calendar Control is appalling!) but how to efficiently retrieve the data? Doing the following (Pseudo code) seems clumsy to me:
FOR day = 1 TO daysInMonth
GET ALL RESULTS events for day/November/2006
LOOP THRU RESULTS
Anyone good any ideas? Am I missing something blindingly obvious?