Hey all
Trying to work out how to get a users rank in a voting system i have
basically the top 10 (or more) is displayed by the following
SELECT vl_cat_id, count(vl_username), vl_username, vl_whovoted FROM vote_log WHERE vl_cat_id = '$vote_cat' GROUP BY 'vl_username' ORDER BY 'count(vl_username)' DESC LIMIT $limit
anyways on the users page i need to show their rank in the voting chart, so how would i do the above, but with WHERE...AND vl_username = '$username' as well. But then to show which position in the query it was at?
Need to do it without working out the whole table, as there will potentially be out of quite a few members
Trying to work out how to get a users rank in a voting system i have
basically the top 10 (or more) is displayed by the following
SELECT vl_cat_id, count(vl_username), vl_username, vl_whovoted FROM vote_log WHERE vl_cat_id = '$vote_cat' GROUP BY 'vl_username' ORDER BY 'count(vl_username)' DESC LIMIT $limit
anyways on the users page i need to show their rank in the voting chart, so how would i do the above, but with WHERE...AND vl_username = '$username' as well. But then to show which position in the query it was at?
Need to do it without working out the whole table, as there will potentially be out of quite a few members