You'd need to use a for loop.
lets say you have
$row = mysql_fetch_array($query)
Then you'd use a for loop that looked like this to loop through the results
for ($i=0; $i <= $total_pos; $i++){
echo $last_name[$i] . "<br>";
}
I started with 0 instead of 1 like you did because the first array key is 0, not 1.
Cgraz