The result of a while loop is different values.
If i print INSIDE the loop it would output the persons id:
1st loop <b>print $row['person'];</b> = 3
2nd loop <b>print $row['person'];</b> = 6
3rd loop <b>print $row['person'];</b> = 20
4th loop <b>print $row['person'];</b> =24
If I print OUTSIDE the loop i have to write:
print $ID_array[0]; = 3
print $ID_array[1]; = 6
print $ID_array[2]; = 20
print $ID_array[3]; = 24
to get the same output.
I would like a script that makes it easy for me to set variables on all the arrays outside the loop.
A workaround is:
$person1 = $ID_array[0];
$person2 = $ID_array[1];
$person3 = $ID_array[2];
$person4 = $ID_array[3];
print $person1;
print $person2;
print $person3;
print $person4;
But in this case I don't know if i have set up enough variables. What if the loop finds twenty persons??
I know it seems odd and it's hard to explain, but I think this is the way I want it to be
