Surendra Singh Surendra Singh - 1 year ago 121
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download