Reputation: 489
How can I delete a table row in using PHP and SQL?
For example when a scheduled event has passed the scheduled date, it is automatically deleted from the table, like an expiration date so to speak. I am currently making a reservation system for scheduled events.
Upvotes: 0
Views: 411
Reputation: 2014
A cron job can be a solution but I rather use a jobs/events on databases for tasks running on databases. Create a stored procedure which will delete desired rows triggered by database job/event.
Upvotes: 1
Reputation: 9549
Deploy a cron job which runs regularly (like once in 15 minutes) and make it delete the rows that are older than a specific date and time.
There is no expiration feature in SQL.
Upvotes: 2