Jems
Jems

Reputation: 1706

How to delete all data that has already expired

I have 6 relation table "books, book_details, book_confirmations, book_completions, member_bookings, and book_participants". I store data into 6 table with confirmation_status = 0;.. I want to delete all of my booking with confirmation status = 0, if the created_at has already passed 1 day.. but I want to delete them automaticly. So, what should I do in my controller especially function __construct()..

Upvotes: 0

Views: 72

Answers (1)

Amin.Qarabaqi
Amin.Qarabaqi

Reputation: 723

you should use Mysql events.

its easier with phpmyadmin. just check if event scheduler is running.

Upvotes: 1

Related Questions