make sure you call srand() only once. my experience has been that the example in the php manual works fairly well.
I have done the same thing and noticed that I was getting duplicates (out of about 40 records total).
what I did to get around this was to add numbers to an array as they were used (you could tack them onto a delimited string, but I found this to be faster to implement)
if your array is zero, there are no duplicates, so just push that random onto the stack. If there are more than one, loop until you find one that isnt in the array.
note, that you need to have some sort of exception when the number of records in the database < number of random records to pull.
srand ((double) microtime() * 1000000);
if (sizeof($arrWinners)) {
while(in_array($iEntryNo, $arrWinners)) {
iEntryNo = rand(0,$iEntries - 1);
}
}
else {
$iEntryNo = rand(0,$iEntries - 1);
}
$arrWinners[] = $iEntryNo;