Updating database collection by OnClick function from a button

Hi,
I am creating a Sport league table that allows the users to see their team’s performance via a table that is connected to a database. They also can add/subtract their numbers. I have designed it in a way that they can just do it by clicking a button. I put 6 buttons in the page that allows them to submit their data to the database. I was wondering if anybody could write me this specific code.