Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
您可以使用 SQL SUM操作员。像这样:
SELECT username, SUM(clicks) As number_of_clicks FROM urls_non_loggedin WHERE username='$_SESSION[username]' GROUP BY username
尽管您应该小心,不要将未经清理的变量传递到查询中。
You can use the SQL SUM operator. Like this:
Although you should be careful from passing variables into your queries that you have not sanitized.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
您可以使用 SQL SUM操作员。像这样:
SELECT username, SUM(clicks) As number_of_clicks FROM urls_non_loggedin WHERE username='$_SESSION[username]' GROUP BY username
尽管您应该小心,不要将未经清理的变量传递到查询中。
You can use the SQL SUM operator. Like this:
SELECT username, SUM(clicks) As number_of_clicks FROM urls_non_loggedin WHERE username='$_SESSION[username]' GROUP BY username
Although you should be careful from passing variables into your queries that you have not sanitized.