Best way of triggering to delete a row from database if 'date` is 'today'?
I made a Diary at http://kees.een-site-bouwen.nl/agenda which can have
Events for specific dates. You can add an event using the form located
here: http://kees.een-site-bouwen.nl/evenementform
As you can see I have 3 fields 'Datum, Van & Tot' (translation: Datum =
date, Van = From, Tot = till) If the time on that specific date expires I
would like to run a script which deletes that specific row from the
database.
I searched on google and found a few things like MYSQL Trigger and PHP
cronjob, but I don't know if there's an easier way to do this? or how to
do it exactly.
My database structure looks like this:
agenda // diary
- - - - // not added the whole structure.
idagenda
titel
waar
www
email
activated
....
....
agendadatum // diary dates
- - - - - -
id
datum
van
tot
idagenda
as you can see I'm using a join to add more dates to one event. How could
I trigger the datetime to delete the rows from the db if the date = today?
NOTE: I am using the Codeigniter framework.
No comments:
Post a Comment