Code:
Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti (trying to connect via tcp://website.com:3306) in C:\xampp\htdocs\whmcs.php on line 8
Warning: mysql_connect() [function.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\whmcs.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.
Code:
<?php
$host = "website.com";
$user = "username";
$password = "password";
$database = "database";
if(isset($_POST["id"])) {
$id = md5($_POST["id"]);
$connection = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
$connection1 = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
mysql_select_db($database,$connection)
or die("Error in selecting the database:".mysql_error());
mysql_query("INSERT INTO id(id) VALUES('$id'");
mysql_close($con);
}
?>
<form action="" method="post">
Admin ID: <input type="text" name="id"><br />
<input type="submit" name="Input ID"><br/></form>
What do I need to fix? This has been edited for the purpose of this help thread.