Thread: MySQL problem
View Single Post
Old 08-07-2006, 12:49 AM  
fatdicksimon
Confirmed User
 
Join Date: Feb 2006
Posts: 226
you could generate a random number then do an if clause inside of the query and say if random number >= something then select a random result only within a certain range of probability_index values (the high end of these values) otherwise, you would select a random result without taking into account the probability_index value.

so... you generate a random number 0-9, and if that random number>1, which will happen 80% of the time, you would only select a random value from the top end of probability_index values. this would cause higher probability_index values to show up more often.
__________________
icq: 199791893
holler at me
fatdicksimon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote