Check if a user has already commented on a post (1 post)

  1. fitztrev
    Posted 7 years ago #

    Is there a way to tell if a registered user, who is reading a post, has already left a comment on that particular post?

    Here's what I have so far:

    SELECT COUNT(comment_id) FROM comments WHERE user_id = USER_ID AND comment_post_ID = POST_ID

    Can anyone help me out further? Are there any existing functions that can do this?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.