Thread: Some PHP Help

Results 1 to 5 of 5
  1. #1 Some PHP Help 
    Gliomaru
    Guest
    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.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,612
    Thanks given
    255
    Thanks received
    989
    Rep Power
    1366
    maybe you could do what most normal people do and take the error literally. the connection timed out.

    you also connect 2 separate times which is pointless.
    .
    Reply With Quote  
     

  4. #3  
    Gliomaru
    Guest
    Quote Originally Posted by Supah Fly View Post
    maybe you could do what most normal people do and take the error literally. the connection timed out.

    you also connect 2 separate times which is pointless.
    There is a solution to everthing. Why would the connection time out when locally connecting?
    Reply With Quote  
     

  5. Thankful users:


  6. #4  
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,612
    Thanks given
    255
    Thanks received
    989
    Rep Power
    1366
    Quote Originally Posted by Gliomaru View Post
    There is a solution to everthing. Why would the connection time out when locally connecting?
    because the server isn't running? because you're using the ip or hostname instead of 127.0.0.1 or localhost? also if you google "mysql error 2002" this thread comes up.
    .
    Reply With Quote  
     

  7. #5  
    Gliomaru
    Guest
    Quote Originally Posted by Supah Fly View Post
    because the server isn't running? because you're using the ip or hostname instead of 127.0.0.1 or localhost? also if you google "mysql error 2002" this thread comes up.
    They are running. I'll just try restarting them.
    Reply With Quote  
     

  8. Thankful users:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PHP] BAsic PHP GD example/Signature
    By Z in forum Website Development
    Replies: 3
    Last Post: 02-05-2011, 11:46 AM
  2. Replies: 20
    Last Post: 08-14-2010, 04:56 PM
  3. [PHP] Server Status Signature [PHP]
    By Naab in forum Website Development
    Replies: 21
    Last Post: 10-22-2009, 06:54 PM
  4. Making a php site with index.php?action=blahblahblah
    By 42 in forum Website Development
    Replies: 0
    Last Post: 04-21-2008, 07:13 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •