I was thinking, what is the best way to manage a form with a variable number of fields?

Suppose you have the fields "phone1", "phone2" and "phone3", how can I insert the data into a database, not knowing how many fields I need to insert before the form gets submitted?