Posted by Joe on 01/07/06 23:00
Hi
I need some help doing a easy php/sql solution to a random selection with
rated stuff.
I have a table like:
Name Rated
--------------
Thompsen 500
Milla 10
Jensen 1
Means that the name Thompsen appears 50 times as often as Milla and 500
times as often Jensen.
I now need some scripting that counts the total ratefactor like
SELECT sum(Rated) FROM Table
In this case 511
And then make a random value between 1 and 511 and then print out the name,
which in this case will be Thompsen 500 of 511 times (in avg)
I need a quick way to find a name based on the Rated factors, any help?
[Back to original message]
|