| | |
How to best rank items based on vote data
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2007
Posts: 1
Reputation:
Solved Threads: 0
Hello, I'm new here. Thank you for your time.
I have a PHP module that I use for user submitted poems. Based on the vote data I have poet rankings.
Table schema:
ratingdbid - int
ratinglid - int
ratinguser - char
rating - int
ratinghostname - char
ratingcomments - text
ratingtimestamp - datetime
rating_favorite - int
Right now people are ranked based on Average score. My thought was to create a batch job to maintain a ranking table I could join into this data. My question is what would be best to calculate the ranking on.
Vote data tallies up to:
Average | Reads | Votes | Comments | Page Slam Wins | # Poems
Of that data I can calculate stdev of scores, remove Min and Max from the averages... I can do all sorts of things.
What do you think would work?
Are there any gammers out there with ideas?
Can you think of a better forum on DeniWeb to ask this question?
I have a PHP module that I use for user submitted poems. Based on the vote data I have poet rankings.
Table schema:
ratingdbid - int
ratinglid - int
ratinguser - char
rating - int
ratinghostname - char
ratingcomments - text
ratingtimestamp - datetime
rating_favorite - int
Right now people are ranked based on Average score. My thought was to create a batch job to maintain a ranking table I could join into this data. My question is what would be best to calculate the ranking on.
Vote data tallies up to:
Average | Reads | Votes | Comments | Page Slam Wins | # Poems
Of that data I can calculate stdev of scores, remove Min and Max from the averages... I can do all sorts of things.
What do you think would work?
Are there any gammers out there with ideas?
Can you think of a better forum on DeniWeb to ask this question?
Last edited by spacebar; Jan 11th, 2007 at 4:12 pm.
•
•
Join Date: Aug 2006
Posts: 138
Reputation:
Solved Threads: 2
You can run a mysql query to calculate the average:
PHP Syntax (Toggle Plain Text)
select avg(rating) from ratings where ratinglid=123 group by rating
You could add another table that adds value to each type of total.
So you can rate a user like:
Like Average X 5.
Reads X 2
Votes X 3
Comments X1
Page Slam Wins X2
# Poems X 4
etc...
And you can also add value to a rating give by a user by making the rating worth more if the user giving the rating is rated higher.. etc.
could get to be a bit of processing with that second one though...
very interesting stuff...
So you can rate a user like:
Like Average X 5.
Reads X 2
Votes X 3
Comments X1
Page Slam Wins X2
# Poems X 4
etc...
And you can also add value to a rating give by a user by making the rating worth more if the user giving the rating is rated higher.. etc.
could get to be a bit of processing with that second one though...
very interesting stuff...
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- Send data on a serial port (C++)
- Changing a datagridview's combobox items based on another combobox (C#)
- Here is the doc file for the assignment (C++)
- VB - How to open an Excel Doc w/ existing data & add data in specific cells? (VB.NET)
- Transferring data to Excel (ASP.NET)
- get posted form data in python (Python)
Other Threads in the PHP Forum
- Previous Thread: Accessing HTML checkboxes with php and javascript
- Next Thread: Can a text link pass php variables?
| Thread Tools | Search this Thread |
apache api array basic beginner body broken cache cakephp class cms code computing confirm cron curl customizableitems database date date/time delete dynamic email error file filter folder form forms forum freelancing function functions gc_maxlifetime google header headmethod howtowriteathesis href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu msqli_multi_query multiple mycodeisbad mysql navigation neutrality oop parameter parsing paypal pdf php phpmysql query question random recourse regex root script search select seo server sessions snippet soap source space sql static system table thesishelp trouble tutorial update upload url variable video web webdesign xml youtube






