Answer the question
In order to leave comments, you need to log in
PHP + mysql notification system. How to do it better?
Hello. I am creating my own project. Made already registration and authorization of users. I don’t really understand how to make the notification system about LIKES or COMMENTS. There will be a table with records, etc. So far, I'm thinking about likes and comments, but a question arose. If I like or comment on another user's post, how do I notify them? So that, for example, there would be a counter above the "Notifications" link. You must have understood me. I mean, something like "My answers" in VK. Please tell me how to develop it? Or tell me what is better to read. Perhaps someone has done something like this.
I apologize if I didn't express myself very clearly.
Answer the question
In order to leave comments, you need to log in
Do you mean the structure of the database?
If so, here is an example:
-users
id, first_name, last_name, email, created
-articles
id, user_id, title, descr, created
- article_comments
id, comment_id, user_id, text, created
- article_comment_views
id, comment_id, user_id, created
If, for example, the author of the article has not read the comment, there will be no entry in the article_comment_views table, respectively, this is a new event, you can notify the user
. You can also just trite when adding a new comment, add a new event for the user to some news table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question