2
I have a table of complaints where I record the information of users who reported and who they reported
id | user | denunciado
1 | userx | userY
2 | userz | userY
and so on, now I would like to do a daily event in mysql that checks whether the number of times the user was reported is greater than an X number of denunciations in order to block the same
I will do a check once a day, just since there are many people who like to "flood" in the denunciations
I decided as follows
UPDATE usuarios SET cadastro=3 WHERE
id IN (SELECT
denunciado
FROM denuncias
GROUP BY denunciado
HAVING COUNT(*) > 30)
Inside an event that will run at 3 am each day
I’m really not good at asking the questions, I wouldn’t have understood what I’m asking if I were going to answer that question, but it was the only way I could express myself, if someone has a suggestion based on the answer and question can edit to help other community members
As I answered, I realized the question is not very clear. Could you edit it to clarify if you want what I answered with the first two queries, what I answered with the third, or if it’s something else?
– bfavaretto
You could create a Rigger to check if the user had number >= x its status could change. [=
– uaiHebert
Another factor so I was in doubt, is by day ? IE, has a date involved ?
– user6026
depends @Fullvio is executed 1 time a day, but it is not evaluated if the user was reported x times that day but in a total of complaints since he registered
– RodrigoBorth
I got it @Rodrigoborth ... vlw
– user6026