Surendra Singh Surendra Singh - 5 months ago 40
MySQL Question

How to update column value after some time interval

I need to update a particular column value from Y to N after every 3 minutes.

Table Structure

`u_id` int(11) NOT NULL,
`status` varchar(11) NOT NULL

How can i change status N after 3 mins for each row in phpmyadmin


It seems like you are looking for something called EVENTS in MySQL.

You may try following steps to achieve.

SET GLOBAL event_scheduler = ON; -- enable event scheduler.
SELECT @@event_scheduler;  -- check whether event scheduler is ON/OFF
CREATE EVENT e_store_ts  -- create your event
      EVERY 180 SECOND  -- run every 180 secs (3 Min)
      UPDATE myschema.youtable set mycolumn='N' -- update this table

To see the events that created


You may visit this link as well.