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 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 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
Archived
This topic is now archived and is closed to further replies.