I have gathered top 10 users for specific task. Using the query given below.
$sqlsum=mysql_query("SELECT `userid`, SUM(`points`) as `total` FROM
`tablename` GROUP BY `userid` ORDER BY total DESC LIMIT 10");
Now , I need to award bonues to the top 10 gathered users only. I am not getting the idea , on how to write query for this purpose.
I need to update one field in tablename = user , field name = bonus .
Kindly guide.
See Question&Answers more detail:os