hardikakbari's Avatar
hardikakbari 3
4 Asked
1 Answered
0 Best
0
No one has voted on this question yet :(
3 years, 2 months ago

how to manage recurring events in database ?

events can recure on any day.. like on every monday, on every thursday.
subsequently we need to show this events in future dates.
Tip for best answer: M$1.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

2 Answers

0
heathhoward's Avatar
heathhoward | 3 years, 2 months ago
3
To store the events in the database...you might try this:

Store the events in an events table with the following fields:

id, startDate, endDate, recurrenceInterval

The events would start on the startDate and recur every x days where X is the recurrenceInterval.

If there are exceptions to the rule, you could store those in an exceptions table by event id.
source(s):
Garnered some ideas from the discussion here:

http://forums.devx.com/showthread.php?threadid=136165

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
arjo's Avatar
arjo | 3 years, 2 months ago
4
If you use Linux as your operating system you can make use of CRON

"Cron is the name of program that enables unix users to execute commands or scripts (groups of commands) automatically at a specified time/date." (Wikipedia) http://en.wikipedia.org/wiki/Cron

Use cron to run a script, that can handle the database event, at the time and date you specify.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates