Easy array stuff I think for those who can I guess.
| From: | Raymond Lilleodegard | Date: | Thu, 05 Dec 2002 22:35:57 +0000 |
| Subject: | Easy array stuff I think for those who can I guess. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127205@lists.php.net to get a copy of this message | ||
Hi!
I am trying to get out a value of an array that I have made from a query and
deliver the value into a variable. I have made this code. Am I totally lost?
while ($myrow = mysql_fetch_array($result));
{
$id = $myrow['id'];
$deltaker[] = array ($id);
}
$limit = count($deltaker);
$finn_vinner = rand(0,$limit);
$vinner_deltaker = $deltaker[$finn_vinner];
$vinner_id = current($vinner_deltaker);
$sql2 = "SELECT * FROM konkuranse WHERE id = '$vinner_id'";
Best regards Raymond