I don't understand why you'd need to do that and it sounds very inefficient.
Personally I'd only store entries for days that have some sort of "event". Then build the calendar for a given month and query the db for all entries in that month. When building the calendar day by day, check to see if an event exists for that "day" from your result set and if so display it.
It might help more to explain what you want the end result to be.
Well I'm new to making calendars so I figure I don't have it that well planned out but here is what I was thinking. Keep in mind that the intention is for this to be used for booking appointments with personal trainers.
My plan is to create a table with 96 time slots of 15 minutes each, since appointments can vary in length and be either 15 minutes, 30 minutes, 45 minutes, 1 hour, 2:30 minutes, etc. long. So, what I would do is fill in the dates for a year in advance and set each time slot to 0 or 1 depending on the schedule of the personal trainer. A 0 means that he is not available in that 15 minute time slot whereas a 1 would mean that he is. So, lets say that a user chooses a training session that is 1 hour long. Then, I would query the database to see where 4 slots are available in succession that equal to 1.
So, lets say for instance that from 2pm-3pm the trainer is available. This would mean that 2:00 has a value of 1, 2:15 has a value of 1, 2:30 has a value of 1, and 2:45 has a value of 1. So, my php script would query the database and add all the time slots in a loop to see where four #1 slots are next to each other.
I realize that this would make my application query the database a hell of a lot since each day of the calendar would have to be searched like this. I'm open to ideas though.
Edited by darkside619, 18 August 2014 - 06:43 PM.