Jump to content

Creating a Calendar

slapshot13's Photo
Posted Feb 05 2010 12:03 PM
2441 Views

I have a student that wants to display a calendar with information for various days and leave blank the days for which no information was entered. I could do it with a crosstab query, but wondered if someone might have ideas on a better approach.

Tags:
1 Subscribe


2 Replies

 : Feb 16 2010 02:08 PM
You seem to imply you have a database of some sort through the "crosstab query" portion of your question, but I find the question in general to be rather ambiguous. There's no statement of which (if any) programming language is involved.

Depending on the goals and the language implemented in you could take a mainly procedural or query based approach to organizing the data. Personally, assuming you have a title, data, and description for each query, I would just do a simple query for that information within the date ranges I am displaying, ordered by date, and step through the results (displaying empty days as necessary) displaying events of interest.
+ 1
  adfm's Photo
Posted Mar 10 2010 10:24 AM

Echoing the comment made by KBenson, I also found this question about calendar database programming a little ambiguous. Since you don't specifically state how you'd like this accomplished, I can only speculate the sort of solution that would appeal to you. Here's a Simple PHP Calendar tutorial by Angela Bradley that includes an approach for dealing with blank days:

while ( $blank > 0 )
{
echo "<td></td>";
$blank = $blank-1;
$day_count++;
}