I have created a HTML form and im trying to link it to a PHP myadmin database.But it says
Warning: mysql_connect(): A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection failed because
connected host has failed to respond. in C:\xampp\htdocs\form.php on line 8 Could not
connect:A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host has failed
to respond.I dont know why thats happening.This is my code below,
<?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();
?>
Can you please help me