How to connect to a database using PHP code?

I am using XAMPP as my web server and Coffee cup software for coding. My task for our project is to formulate PHP codes for our simple website. What particular PHP code shall I use to connect to a database?
