forget about arrays and just use the random function built into mysql:
<?
$result=("select * from table order by rand() limit 1");
$id=mysql_result($result,0,"id");
echo $id;
?>
however if there is some reason you must use arrays.. do this. keep in mind there is a random function to pick a random key in an array , . but i find that it is not as random as it should be. i'd use this method instead.
<?
$result=("select * from table order by rand() limit 1");
while ($myrow = mysql_fetch_array($result))
{
$array[]=array($myrow["id"]);
}
// get the size of the array
$count=count($array);
// set random number
$rand=rand(0,$count);
// print the random id
echo $array[$rand];
?>
hope this helps.. have fun =)