The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
If you dont know what i mean this site uses what i am talking about:
http://www.lemonzoo.com
thanks for any help!
AJ
Again all help is very much appreciated!
AJ
Then to display the average, you just echo $average, and to calculate the new average when someone else rates, you would do:
$average = (($average * $total) + $newrating) / ($total + 1);
$total = $total++;
Obviously you might want to neaten that up or whatever, but it'd work, and would only need 2 columns in a database, and to simply display the average rating would require no processing.
Or even have two columns $totalrating and $totalusers
$average = $totalrating / $totalusers;
And when someone rates, just do:
$totalrating += $newrating;
$totalusers++;
Pic ID | averageRating | numberofRatings | TotalRating
PicID being the primary key.
All of them being ints.
Then have php code to insert someones rating to the database.
This would take the rating they enter and add it to the total rating and also increase numberofRatings by 1. Then use these to work out the new averageRating.
Shouldn't be too hard. Not really sure on tutorials though.
If you dont know what i mean this site uses what i am talking about:
http://www.lemonzoo.com
thanks for any help!
AJ