Of course it won't work; your code does not make sense.
To begin with, your SQL query looks for ALL customers, not just the one who might be using the form. You need to add a WHERE clause to the SQL to narrow it down.
Further, mysql_query() returns something known as a result set, which might contain zero to many rows of data.
You can't address that data directly; you have to use one of the fetch functions. The function mysql_fetch_array() is one of them. You're using it. That's fine, but ...
When you call mysql_fetch_array, you advance an internal pointer in the result set.
Notice how your code contains two while() loops. Why? If your SQL has returned one, and only one, record, then there should not be a while() loop at all.
Naturally, your second call to mysql_fetch_array() won't return anything, because the result set is exhausted. Your first call has run through the entire result set, returning the last object found.