mysql - resetting column values after time -


i new phpmyadmin , sql databases.

i know how can add "script" resets value in columns of table after time period -> want column set int value 0 every 72hours every row. possible , how?

what want called "event". here's potential definition; needs may vary.

create event `zero_my_column`     on schedule         every 72 hour starts '2015-07-13 00:00:00'     on completion preserve     enable begin          update mytable set counter = 0 counter <> 0; end 

there's configuration work do ensure mysql server run event correctly.

this actual update query.

update mytable set counter = 0 counter <> 0; 

notice where clause. prevents redundant updating of rows have 0 column value counter.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -