hey, i'm going to hold a competition soon on my website, and to pick the winner i want to use a random function to pick a specific id number
i tried editing a password generator script to try and make it work but it seems that it didn't like to work under those conditions
heres what i'm trying to work with...
<?
include("includes/auth/common.php");
function rnd_Pass()
{
$sql = "SELECT id FROM polyphonics";
$query = mysql_query($sql);
srand(microtime() * 1000000000000);
$pass_rnd = mysql_fetch_array($query) ;
$rnd = array_rand($pass_rnd, 2);
$password =$pass_rnd[$rnd[1]];
return $password;
}
$pass = rnd_Pass();
echo $pass;
?>
when i run this i get -
10428
and when i try refreshing the page, its still all i get
any ideas?
thanks