Link to home
Start Free TrialLog in
Avatar of kansun
kansun

asked on

Mysql Event Scheduler

This is what i need to achieve using Mysql scheduler. I believe its a new feature in MYSQL 5.1
I have a table with foll fields
event_name
event_desc
todays_clicks
event_link
date_from
date_till

At the beginning of each day , that 12:00 am every day i need to update the todays_clicks field to "0" (Thats zero).

I was wondering anyone has the experience in doing this... It will be a wonder and a great thing if any experienced MYSQL guru can show me step by step with instructions. with a code.

Thanks a millions in advance..

ks
Avatar of johanntagle
johanntagle
Flag of Philippines image

Try:

CREATE EVENT reset_clicks
ON SCHEDULE EVERY 1 DAY STARTS '2012-02-01 00:00:00'
ENABLE DO
update table_name set todays_clicks=0;

I've really used it only once, but the instructions at http://dev.mysql.com/doc/refman/5.1/en/create-event.html should be quite easy to follow.
Avatar of kansun
kansun

ASKER

This is not working for me. I wonder if any Guru can solve this. Thanks in advance.
May be you can create it yourself and test it, that will really help me out.

Kansuns
what was the error?  if you really want to learn this, then take the time to try to figure it out, not ask somebody to do itfor you.
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kansun

ASKER

awesome