GetDotted Domains

Viewing Thread:
"Picture rating system."

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.

Mon 17/01/05 at 22:28
Regular
"www.funrunner.co.uk"
Posts: 289
Just wondering how i would go about creating a picture rating system as found on many other sites? Any tutorials you people would recomend? How many MySQL tables will it need? Any information regarding this would be very helpful

If you dont know what i mean this site uses what i am talking about:

http://www.lemonzoo.com

thanks for any help!
AJ
Tue 18/01/05 at 21:06
Regular
"NULL"
Posts: 1,384
Although this isn't a complex problem, it would definitely be of use to you to have a look at the basics of PHP and MySQL first. Even if someone here was to give you all the code you need to do it, it would still need to be integrated into your site, and you would need to set up the MySQL database and things yourself. This would require some knowledge at least of PHP/MySQL.
Tue 18/01/05 at 20:18
Regular
"www.funrunner.co.uk"
Posts: 289
ah perhaps i should have mentioned my beginner status in php and mysql! i have used both before but this has generally been with other peoples code. Does anyone know any tutorials or help files which have been made to help in this particular task because i dont want to learn all of php or mysql just this task!!

Again all help is very much appreciated!
AJ
Mon 17/01/05 at 23:39
Regular
"NULL"
Posts: 1,384
You could even do it just knowing the number of people who have rated, and the average, for example, $average and $total

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++;
Mon 17/01/05 at 22:36
Regular
"Picking a winner!"
Posts: 8,502
You'd probably get away with just the one table with something like

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.
Mon 17/01/05 at 22:28
Regular
"www.funrunner.co.uk"
Posts: 289
Just wondering how i would go about creating a picture rating system as found on many other sites? Any tutorials you people would recomend? How many MySQL tables will it need? Any information regarding this would be very helpful

If you dont know what i mean this site uses what i am talking about:

http://www.lemonzoo.com

thanks for any help!
AJ

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Continue this excellent work...
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do, I am delighted.
First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.