MYSQL Timestamp adding time

Dell / Lap top
September 30, 2009 at 13:03:42
Specs: Windows XP, pentium 4
Hi Guys, I have a table with a timestamp (ts) and status field and I want to update it if todays date (when the script is run) is greater then or equal to two days or more. This is what I am trying to write in easy terms.

UPDATE sale SET status=5 WHERE currenttime>=(ts + 2 days) && status=1

I know this can be done strickly with mysql. I am going to run this script once a day automatically but I need this query worked out. Any thoughts.

See More: MYSQL Timestamp adding time

Report •

October 1, 2009 at 01:16:02

UPDATE sale SET status=5 WHERE NOW()>=DATE_ADD(ts, INTERVAL 2 DAY) AND status=1

Report •
Related Solutions

Ask Question