WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] comment_ID in WP2 (3 posts)

  1. marcelfahle
    Member
    Posted 8 years ago #

    Hi everybody,

    there's something strange with the coment_ID() Tag in WP2.
    Always when I delete a comment, the ID of the relating comment gets lost too.

    Take a look:
    I've setted up a new version of my weblog and mad two comment tests on the first post. After testing, I've deleted these two comments. When you look now on this post,
    you'll see that two comment IDs are missing (+ a few in
    the middle in case of further testing).
    to first post of marcelfahle.com

    Your help is very much appreciated. Thanks!

    Marcel

  2. Tijmen
    Member
    Posted 8 years ago #

    That's probably the way MySQL works. It gives each comment a number and then remembers which one is next, it doesn't correct that after a comment (or post, or user, or category) is deleted.

  3. marcelfahle
    Member
    Posted 8 years ago #

    Hmmm, good point Tijmen. The comment_ID value comes from the comment_id field in the database, which is marked as auto_increment. So I have to build a loop which will count the published comments in a post. I always thought (and I don't use WP since yesterday ;)) that the comment_ID Tag would do the job.

    Thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags