Use variable  for 'name' column in database insert/update

Template names column is "templatename"; remainder happen to be "name" that matches the literal.