Modified Update Button

Made update button choose between inserting a new row and updating it
based on whether the ID was already in the database.