All that while loop is checking for is if $query = something... which since you are using a string that stays constant its always going to be assigned at the very least
"UPDATE SET WHERE username='$username'"
Now what you need to do is count how many elements are in the array using the count() function. Then just use a for loop (or while loop if you wanted) and go through each element of the array one by one until you have gone through it count() times.
PHP Code:
$count = count($array);
for($i=0; $i < $count; $i++)
{
// do whatever with... $array[$i]
}
Also keep in mind (I don't know if this will work in your exact situation), but you can update more then one column of the same row at a time, just format your query like
PHP Code:
UDPATE table_name SET column1='value1', column2='value2', column3='value3' WHERE username='$username'