kool_samule Posted July 19, 2012 Share Posted July 19, 2012 Hi Chaps, Apologies if this topic should be in MySQL...I wasn't sure. I'm trying to create a MS Outlook-style Appointment application with Recurrence for a PHP calendar. I've got all the same options that Outlook gives, e.g.: Daily - every DAY, or every WEEKDAY Weekly every X WEEK(S) on X DAYS Monthly - on DAY of every X month or Nth DAY of every X MONTH(s) Yearly - recur every X YEAR(S) on DAY of MONTH or Nth DAY of every X MONTH(s) My question is what is the best way to store the recursive appointment information in MySQL Database (Columns, etc), so I can then use a PHP algorithm to calculate whether an appointment is within a calendar view, or if reminders need to be sent. Any advice will be a great help. Quote Link to comment https://forums.phpfreaks.com/topic/265945-php-mysql-for-recursive-calendar-appointments/ Share on other sites More sharing options...
xyph Posted July 19, 2012 Share Posted July 19, 2012 Are you having a start/end date for this recursion? I'd have 3 extra columns. recursion_start (datetime) - this would store the first occurrence of the recurring event. this should be used to calculate what time/day of month/day of week/etc the future events will take place. recursion_end (datetime) - possibly optional, if optional, then you'll have to keep this in mind when querying for a given period... WHERE recursion_end IS NULL OR recursion_end >= $calendar_starting_date recursion_type (varchar) - this would hold information about how you want the recursion to be performed. You have to write a function that parses this information, and decides which dates to create this event on. You'll have to calculate recursive events separately form single events, but overall it should be pretty simple to implement Quote Link to comment https://forums.phpfreaks.com/topic/265945-php-mysql-for-recursive-calendar-appointments/#findComment-1362823 Share on other sites More sharing options...
Barand Posted July 20, 2012 Share Posted July 20, 2012 If it's Outlook-style then you need the facility for "Do you want to change just this event or change the whole series?" Quote Link to comment https://forums.phpfreaks.com/topic/265945-php-mysql-for-recursive-calendar-appointments/#findComment-1362925 Share on other sites More sharing options...
kool_samule Posted July 20, 2012 Author Share Posted July 20, 2012 Thanks guys, Advice is noted..I'll crack on and hopefully get it sorted. Cheers for the help. Quote Link to comment https://forums.phpfreaks.com/topic/265945-php-mysql-for-recursive-calendar-appointments/#findComment-1362957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.