每当有人报告用户时,如何增加行(INT)的值? [英] How can I increase the value of a row (INT) every time someone reports a user?
本文介绍了每当有人报告用户时,如何增加行(INT)的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个基于用户的网站,其他用户可以报告行为不端的用户。
我有一个用户数据库表和其中一列是报告的次数(默认值0)。当其他人报告用户时,此列中的值会增加,例如,如果3个单独的用户报告用户A,则用户A的报告计数将为3.
我的问题是:
最好的方法是什么?
非常感谢,
Joel。
I am trying to create a user based website, where other users can report users that misbehave.
I have a database table for users and one of the columns is a count of the amount of times they have been reported (default value 0). As a user is reported by others, the value in this column goes up, for example, if 3 separate users report user A, user A's report count would be 3.
My question is:
What would be the best way to do this?
Many thanks,
Joel.
推荐答案
>最好的方法是什么?
您可能需要考虑在生成报告时向报表中添加一行。计算与特定用户关联的行将为您提供报告计数。这具有检索特定时期或特定用户或两者的计数的额外好处。
/ ravi
> What would be the best way to do this?
You may want to consider simply adding a row to the Report table when a report is made. Counting the rows associated with a specific user will give you the count of reports. This has the added benefit of retrieving counts for a specific period, or by a specific user, or both.
/ravi
这篇关于每当有人报告用户时,如何增加行(INT)的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文