I have sent_date and status column in my database table.currently status of the post is = Sent/Received. All I want to change the status = Aborted after 5days automatically.
What I Tried:
CREATE EVENT reset ON SCHEDULE EVERY 1 day DO
update barter_proposals
set proposal_status="Aborted"
WHERE `sent_date`>=DATE_ADD( CURDATE(), INTERVAL 1 day )
AND proposal_status = "Sent/Received"---------Not worked
CREATE EVENT rot ON SCHEDULE EVERY 1 day DO
update barter_proposals
set proposal_status="Aborted"
WHERE DATE_ADD(sent_date, INTERVAL 1 day )>=NOW()
AND proposal_status = "Sent/Received"---------Not worked
CREATE EVENT rot ON SCHEDULE EVERY 1 day DO
update barter_proposals
set proposal_status="Aborted"
WHERE sent_date=CURDATE()
AND proposal_status = "Sent/Received"-----------Not Worked
Can anyone tell me what to do in order to update the status automatically after 5 days.sent_date can be anything.
If sent_date is 26/03/2018 then on 01/04/2018, the status should update to Aborted automatically.Can anyone provide me the logic?
Any help will be highly appreciated.