How to access from php container to mysql container through localhost or 127.0.0.1?

Can I have an example of such a solution with a host network?
I couldn’t get the containers working through network_mode: host