What is the best method for storing data in database for a simple calender?
This calender is with hours:
2011-12-17 | 2011-12-18 etc
00:00 | 00:00
00:30 | 00:30
01:00 | 01:00
01:30 | 01:30
etc
I can for each hours set TRUE or FALSE. The default is FALSE.
For each day, I can create new row in database, for example:
id | day
1 | 2011-12-17
2 | 2011-12-18
etc
How I can I do this with hours? I would like to store in the database only days with set = TRUE. Is it possible? or I must create in database each hour?
On the page, I can generate days with loop for, but how and how can I show on this also days with TRUE on database?
I’d set up my db with 3 columns,
id | day | hoursand on hours, store a serialized array of the hours.