No, it shouldn't. The record set is exhausted by the first loop. You'll need to refresh it before looping again. Looking at the function list, there doesn't seem to be anything that could be used.
But if I'm going to be using something more than once I prefer to put it in a variable (an array in this case) and get it from there when I need it. Faster.
$result_array= array();
while($row=mysql_fetch_array($result))
{ $result_array[] = $row;
}
And then loop through $result_array instead.
foreach($result_array as $i)
{ // use $i[] the same way as you were
}