SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    UK
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to represent a calendar in database?

    What I want to do is represent a calander in my database. Their should be one entery for each day.

    For example something along the lines of http://www.merenkov.com/calendar/try.htm

    However short of having a entery in my table for every day of the year is their a better way to represent this structure in the database?

    The only way I can think is to add say 1000 enteries in a table, each entery representing a day.

  2. #2
    SitePoint Guru puco's Avatar
    Join Date
    Feb 2005
    Location
    Slovakia
    Posts
    785
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You only need to store dates that have some status stored in them (Booked, Pending etc.) you don't need to store the dates that have N/A in them. And when you want to display to calendar just select dates from specific time period (a month) and write a logic that displays all dates that are not in the record set as N/A.
    Martin Pernecky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •