• I am using INSERT_INTO to put my comments into my database. The comment_content, comment_author, and comment_post_ID get inserted into the database but the comment_count for the post doesn’t increase automatically. Do I have to do it manually? Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter shatterjack

    (@shatterjack)

    does anyone know how comment_count gets its value?

    Thread Starter shatterjack

    (@shatterjack)

    I’ve tried doing an INSERT to add the new comment, and an UPDATE to update the comment_count:

    mysql_query ("INSERT INTO wp_comments(comment_content, comment_author, comment_post_ID) VALUES ('$_POST[commenty]', '$_POST[author]', '$_POST[number_of_the_post]')");
                        mysql_query ("UPDATE wp_posts SET comment_count=comment_count+1 WHERE comment_post_ID = '$_POST[number_of_the_post]'");

    The comment gets added but the comment_count doesn’t increase…

    Thread Starter shatterjack

    (@shatterjack)

    when there is an unapproved comment and I approve it in the dashboard, it updates the comment_count automatically for that post, but then if I post to it while I am logged in, it does not update it. What am I doing wrong with that code above? Thanks…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘submitted comment not increasing comment_count’ is closed to new replies.