MySQL class / function to auto add tenant_id and userid to the query

I am trying to build a multi-tenant application, each customer will have their account setup on a subdomain1.example.com and subdomaion2.example.com.

The DB structure has all the data into single tables in single DB along with their domain name (tenant_id) and the user who inserted the data.

I wanted to know, what’s a better way to ensure that the tenant_id and the ownerid are automatically added to every crud.

eg: INSERT into table1 (value1,value2,value3)

and the tenant_id and the ownerid are automatically added