2 Fields In Different Databases

We will add 2 fields to invoice tpl file. These two fields are in same server but in different databases. to which php files we must add ?