Call a custom module's function from template file
a function doesn't have a url unless you set up a callback url for it first with hook_menu. Then you can point your link to it and process the data. So in your case it'd look something roughly like that:

In your custom module:

function mymodule_menu() {
  $items['some_url/%'] = array(
    'page callback' =&gt; 'mymodule_myfunction',
    'page arguments' =&gt; array(
      1,
    ),
  );
  return $items;
}

function mymodule_myfunction($id) {
 // update database
}


Then in your template use l() as Kevin mentioned (you should adjust to fit your variables etc):

print l('Action', 'abc/20');


This is very simplified. You'd want to probably enable some access limitations on that new url (abc/%) etc and you can read more about that in the hook_menu docs I linked to above.