Encryption data with php

I’m wondering how to approach the topic of data encryption. Maybe some of you have already faced something like this and can give me some advice.
I would like to keep data on two different servers for security.

The premise is:
script 1 [server 1] queries script 2 [server 2] for data. Part of the data will be stored on server 1, and part on server 2. Only after combining the data from both servers, it will be possible to read the correct data.
I am wondering how to secure this script so that if someone breaks into server 1, they will not read the data, because they will not have access to server 2.

Anyone got any ideas? Thanks!