There is information in the PHP Manual regarding MySQL for example.
Example 1. MySQL connect example
<?php
$link = mysql_connect("localhost", "username", "secret") or die("Could not connect");
print ("Connected successfully");
mysql_close($link);
?>
Go to www.php.net and search for MySQL or download the manual. Look under Function Reference and then MySQL.