MySQL connectivity with PHP

<!-- Save as config.php -->
<?php
$servername="localhost";
$dbusername="root";
$dbpassword="";
$dbname="your database name";


if(!$connect = mysql_connect($servername, $dbusername, $dbpassword))
echo mysql_error();
if(!$db = mysql_select_db($dbname, $connect))
echo mysql_error();
?>