Html form cannot connect to a database
<p>I have created a HTML form and im trying to link it to a PHP myadmin database.But it says</p>

<p>Warning: mysql_connect(): A connection attempt failed because the connected party did not </p>

<p>properly respond after a period of time, or established connection failed because </p>

<p>connected host has failed to respond. in C:\xampp\htdocs\form.php on line 8 Could not </p>

<p>connect:A connection attempt failed because the connected party did not properly respond </p>

<p>after a period of time, or established connection failed because connected host has failed </p>

<p>to respond.I dont know why thats happening.This is my code below,</p>

<pre><code>&lt;?php

    define('DB_NAME','Registernewaccount');   
    define ('DB_USER' ,'root'); 
    define('DB_PASSWORD','12345'); 
    define('DB_HOST','localhost');  
    $link = mysql_connect('DB_HOST','DB_USER','DB_PASSWORD'); 

    if (!$link){  

        die('Could not connect:' . mysql_error());      
    } 

   $db_selected = mysql_select_db(DB_NAME,$link);        

   if(!$db_selected){         

       die('Can\'t use' .DB_NAME .':' . mysql_error());        
    }     

    mysql_close(); 

?&gt;     
</code></pre>

<p>Can you please help me </p>
