assign a specific value to an array element using a MySQL query

The idea is to run a sort of ranking MySQL command such as:\[code\]$sql = mysql_query("SELECT f_score FROM ".TBL_FACTIONS." ASC");\[/code\]EDIT: I do need to add a WHERE f_id = $id in here too.\[quote\] The numeric value in my MySQL database table in the *f_score* column should determine the rank. f_score contains only numeric values, from 0 to anything, user actions add and subtract from the score.\[/quote\]then use the $sql to loop through an array and "rank" each array element.I think it should assign a number to a specific variable so I can echo the number out on the webpage. \[quote\] E.g. Your rank is: 01\[/quote\]I'm looking for something lightweight, but if its not possible to do this win minimum server usages, I'll have to shove it into a cron job or something which isn't really ideal.I was thinking along the lines of array and loops or something similar?Any help would be greatly appreciated! -Callum
 
Back
Top