Check if a user has already commented on a post
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?
- The topic ‘Check if a user has already commented on a post’ is closed to new replies.