Support » Fixing WordPress » comment_ID in WP2

  • Resolved marcelfahle


    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

    Your help is very much appreciated. Thanks!


Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘comment_ID in WP2’ is closed to new replies.