I'm doing a class that randomly picks an advertisement to display.I place all images that fit the parameters into an array. the code I use to get the random number is:
$count = mysql_num_rows($result);
mt_srand((double)microtime() * 1000000);
$tv = mt_rand(1, $count)% ($count);
Then I return $retval[$tv];
This repeatedly picks 3 of the 7 images I have up for testing(2,5,7), is there a better way to seed mt_rand() ????