PHP is an open-source server scripting language. It is typically used in conjunction with database systems such as MySQL, which provides the back-end database functionality for database-driven websites. MySQL is a free database application that is used extensively with PHP-based Web application systems. To connect to a MySQL database, you need to use the PHP Open Database Connectivity (ODBC) function "odbc_connect" within specific syntax.

<?php
$dbase_host = "YOUR_HOST";
$dbase_user = "YOUR_USER_NAME";
$dbase_pass = "YOUR_DATABASE_PASSWORD";
$dsn = "DRIVER={MySQL ODBC 3.51 Driver};" .
"CommLinks=tcpip(Host=$dbase_host);" .
"DatabaseName=$dbase_name;" .
"uid=$dbase_user; pwd=$dbase_pass";
odbc_connect($dsn, $dbase_user, $dbase_pass);
?>
Replace "YOUR_HOST" with the correct host, which is typically "localhost." If you're connecting to a database via an online Web hosting company, confirm the MySQL server host name with the company. Replace "YOUR_USER_NAME" with the user name of your database, and replace "YOUR_DATABASE_PASSWORD" with the password of your database.