How do I automate MySQL Update or Insert upon expire timestamp?
So let say timestamp is 2013-06-30 20:10:00
and I would like to auto update MySQL DB upon passing that date and time so today after 2013-06-03 20:10:00
.
I want to update my item, but I will not have browser open with my website, so I think so I need some kind of server trigger?? How do I do that? Many thanks
I have following Query to execute every 1 second and it doesn't work:
CREATE EVENT e_second
ON SCHEDULE
EVERY 1 SECOND
DO
UPDATE online_auctions.auction_status
SET auction_status = 'ENDED' WHERE TIMESTAMP(auction_end_date) < (select now());
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…