How do I update my php and mysql template?

I have a couple of scripts from the same template but different version. I am using php and mysql. I need to know how to update the mysql database and the script from version 1 to version 2 with a single click.