0

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()..

shilovk
  • 11,718
  • 17
  • 75
  • 74
Jems
  • 1,666
  • 4
  • 20
  • 50
  • 2
    For deletion I believe you have to use a scheduled task that run the delete script. Option two, you could have a function that checks the table for expired bookings and delete them every time the user every time the user open the view. Option 3, you don't show them to user. Just select with the condition created_at > 1 day. I think this is best if you need statistics of how many expired bookings. – strike_noir Sep 26 '17 at 01:41

1 Answers1

1

you should use Mysql events.

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

Amin.Qarabaqi
  • 661
  • 7
  • 19