Johns3n Posted August 3, 2010 Share Posted August 3, 2010 Hi PHPFreaks.com I wrote in here a while ago about updating table rows by selecting rows which end dates is greater than the current day, much like a experation dates with blog posts in a CMS. I was told to make sure my datatype for the end dates in the database was the datetime format is YYYY-MM-DD HH:mm:SS now I have now changed that, but I am still have trouble creating a query that does exactly what I mentioned. mysql_query("UPDATE ". $db_prefix ."events WHERE end_time >= TIMESTAMP: Auto NOW() SET cat = 1" ); Now what I am trying to is that if the current time is greater than the end date I need the "cat" row changed to 1 So thanks in advance if you can help me guys Quote Link to comment https://forums.phpfreaks.com/topic/209645-problem-with-selecting-specific-dates/ Share on other sites More sharing options...
JonnoTheDev Posted August 3, 2010 Share Posted August 3, 2010 UPDATE tablename SET cat=1 WHERE CONCAT(CURDATE(),' ',CURTIME()) > end_time Quote Link to comment https://forums.phpfreaks.com/topic/209645-problem-with-selecting-specific-dates/#findComment-1094528 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.