Light reputation script

I’m making a chat for practice and I want to add a reputation counter to each message. If the answer is good, then the user clicks on the up arrow and plus the point, no – vice versa. It would be better if, when adding each message, they would be summed up and be the user’s reputation. Well, or, at least, on the user’s page, there is a regular poll, but not cumbersome, are there any?

Answer 1, authority 100%

If you write, it will be. You say for PRACTICE, why do you need ready? You would start first, and then when you hit a problem, ask. So it will be easier for you and those who answer.

To solve this problem, you need to know the structure of the database. How a user logs in, well, there are a lot of things that only you know about!