Ok.. you can do this by having a separate page for editing records (or you can incorporate it into the same page and have different modes of operation (i.e. Add, Edit/Delete, etc.)

Your submit button for the edit functions would be trapped by an if/then statement in the code at the top that would perform the update on the database with the new data. (Give your edit submit and your add submit different values so you can differentiate which one was clicked on the server side when the page is reloaded and the data is saved)