MySql Database Connection in PHP

<?php
$dbhost = "localhost";
$dbname = "root";
$dbpasswd = "yourpassword";

$connect = mysql_connect($dbhost, $dbname, $dbpasswd);

if($connect)
echo "DataBase Connection Established ! ";
else
die("Error : " . mysql_error());

?>