dannyluked Posted August 18, 2009 Share Posted August 18, 2009 Hi, Is there anyway I could edit topics with 6+ replies and make level = 2. I know how to count the number of replies but I just need the code that actually changes its level. I also need a code that will delete any topics where last reply = 7 days ago. Thanks for any help Link to comment https://forums.phpfreaks.com/topic/170862-solved-auto-update/ Share on other sites More sharing options...
Maq Posted August 18, 2009 Share Posted August 18, 2009 Something like this should work (not tested): UPDATE table_name SET level = 2 WHERE topics IN(SELECT topics, COUNT(topics) AS cnt FROM table_name HAVING cnt > 5); Should be the same idea with DELETE. Link to comment https://forums.phpfreaks.com/topic/170862-solved-auto-update/#findComment-901141 Share on other sites More sharing options...
dannyluked Posted August 18, 2009 Author Share Posted August 18, 2009 Thanks! Link to comment https://forums.phpfreaks.com/topic/170862-solved-auto-update/#findComment-901201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.