Computing.Net > Forums > Web Development > MYSQL Timestamp adding time

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MYSQL Timestamp adding time

Reply to Message Icon

Name: BigShow
Date: September 30, 2009 at 13:03:42 Pacific
OS: Windows XP
CPU/Ram: pentium 4
Product: Dell / Lap top
Subcategory: PHP
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: jon_k
Date: October 1, 2009 at 01:16:02 Pacific
Reply:

try

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


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: MYSQL Timestamp adding time

Php/mySql/Phorum problems www.computing.net/answers/webdevel/phpmysqlphorum-problems/932.html

IIS and phpbb www.computing.net/answers/webdevel/iis-and-phpbb/1808.html

echo datetime so as more readable www.computing.net/answers/webdevel/echo-datetime-so-as-more-readable/2411.html