Wait... let me see if I understand correctly. You have a database of users... let's say their numbers are 1, 2, and 3. So to pick a random user, you set up a loop, pick a random fraction (let's say it's .25) which you multiply by the highest id # (which is 3). So 1/4 of 3 is .75 so you then check the database to see if there is an id # .75 - and of course, there is not, since the numbers are 1, 2, and 3. Is that right? So you are forcing your poor CPU to pick trillions of random numbers waiting until you get exactly .33333, .66666 or 1.000000. Do I have that right?
Ok. That's the wrong way to do it. Instead, read the ID#'s into an array like this:
$id[0] = the first id #
$id[1] = the second id #
$id[2] = the third id #
etc.
Then pick a random number between 0 and the number of elements in the array like this:
$r = rand(0,count($id));
Then the lucky winner is $id[$r]
So you only have to pick ONE random number instead of a trillion. Your poor CPU doesn't overheat trying to pick a winner. You get an answer in 1/100th of a second instead of 3 minutes or more.
Many people would suggest a simpler method. They would put the random function inside the SQL statement instead of reading out all the ID #'s into an array. And that's pretty smart. Then, instead of reading 32700 numbers into an array, you only have to pick one item from the MySQL table. That's probably the most efficient way.