Two forms with multiple submit buttons in single PHP file
===

I am trying to write a dynamic form using PHP. I'd like to have a single webpage that contains two forms:

 1. The upper form allows to search for an element in the mysql database, e.g., for a name
 2. The lower form shows the data that is associated with this name in the database

If I press on the "Search" button of the upper form, then the the lower form is shown and the text fields are filled with data from the database that belong to this name. If I change the user name to some other value and press again "Search", then the data that is associated with the new record is shown and so on. 

The lower form also has a button "Update" which allows to transfer changes made to the text boxes (in the lower part) to the database.

Now, I have the following problem: In my script I set initially the value of name (from the upper form) to "". When I then press the "Search" button, then the lower part of the form is shown and the corresponding data is shown in the lower part. When I then press the "Update" button, then the text field associated with name is set to the empty string. This is because in my script I set initially name to the "". I'd like that in this case the data entered in the upper form is not changed, i.e., it stays the same.

I guess, I am missing something here. There is probably an easy solution for this and I am doing something fundamentally wrong. It'd be great if you could help me.

Regards,
Sebastian