Database
Sample database cart table contains four columns cart_id, user_id, product_id and created_at.

Enable MySQL Event Scheduler
Start MySQL event scheduler by executing following query in PhpMyAdmin or MySQL command prompt.

 

Create a Event
Here the following event will run everyday and clear/delete 10 days old data from cart table based on time stamp

 

Alter Event
If you want to modify the Read More →