Calculate user ranking
I'm trying to work out how to rank a user based on their progress compared to other users.
Here is a simplified example of the structure:
A user can have multiple number of logs but duplications of the same book shouldn't be counted.
To calculate a book completion percentage i have
$percentage = round(($total_books / 100) * $total_number_of_unique_logs, 2)
but how would i calculate their progress compared to the percentage of other users?
Any help would be great.
Sounds like a job for a relational database (like MySQL). Is your data stored in a database?
Yeah all the info is stored in a mysql database, its just the process of using that information to get the desired results out that i need help with.
I would let mysql do the work for me. But first, I would get my relational data in the database named correctly. Make it like below, so that book_id in your log table relates to book_id in books table, same with user_id... nit picky observation of mine. ;)
|All times are GMT. The time now is 10:48 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0