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 Quote 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. Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/170862-solved-auto-update/#findComment-901201 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.