I’ve built a couple of calendars before using PHP and MySQL. Simple calendars that store the events in a single table - event name, date, time etc.
I’m planning a re-write of a calendar which will include repeating events.
Could someone with experience give me some tips on a good database schema?
I don’t want to get stuck doing a dozen for loops in php with a dozen db queries.
I was thinking of a varchar field to flag the repeating dates. For instance, the field would have either a 0 or 1 to represent a repeating day for any day from sunday through saturday. Thus 7 digits would represent the 7 days.
For example, 0110001 would represent that the event repeats on monday, tuseday and saturday. 1111111 would represent that the event repeats every day or 0000000 would represent that the event is not repeated.
The other throught would have a table for the basic event information and another table with entries tied back to the first table based on an event id.
I’m just kinda stuck on what fields and how to encode the data in those fields.
Any suggestions or tips would be helpful.