is there a way or a function to access a variable that is inside a loop...outside.... like you would do with a function to setting it to global.
eg
while($data = mysql_fetch_array($result))
{
$data['firstnames'];
}
//latter in the script
echo $data["firstname"];