Feb 06 2008

修复wordpress评论数

Category: 技术ssmax @ 15:26:42

以前很多垃圾comment都删掉了,在mysql里面直接删的,没有更新wp_posts表,今天搞了一次

 update wp_posts set comment_count = (select count(*) from wp_comments where comment_post_ID=ID);

 貌似子查询是mysql5才有的吧。。。

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.