php - Calculating rank and awards from MySQL database on a rating website -
i have rating website people can "award" people awards: "cutest", "awesomest", "i you", "hottest", "prettiest", "funniest", etc , negative ones "lamest", "stupidest", "i hate you", etc.
when adds new person using rate page, stored in table these columns: from,to,award. example if userid 5, , person giving award "cutest" 10, stored this: 5,10,cutest.
now thing is, want give people ranks, firstly, based on each award.. person got "cutest" awards.. , then, based overall, person got positive awards. overall, people should downrank if have many negative awards, , uprank positive awards.
i cannot (because of way script coded) have table counts like: id,award,count (which 10,lamest,20, mean user id 10, , 20 lamest awards given).. how calculate it? efficient way, in php.
thanks lot.
please think on said regarding "cannot (because of way script coded)". i'm sure you'll find out can that. each time, before inserting new line, update existing line, if such exists...
Comments
Post a Comment