making connection code dynamic
<p>the connection to database via PHP is as:</p>

<pre><code>&lt;?php
$DbHost = 'localhost';
$DbName = 'root';
$DbUser = 'root';
$DbPwd = '';
$dbConn = mysql_connect ($DbHost, $DbUser, $DbPwd) 
    or die ('MySQL connect failed. ' .mysql_error());
mysql_select_db($DbName,$dbConn) or die('Cannot select database. ' . mysql_error());
?&gt;
</code></pre>

<p>Here I've hardcoded my hostname, username and password. Everytime I take my project to another machine, I've to change it.
<strong>How can I make this connection code dynamic</strong>?</p>
