3 Replies - 1492 Views - Last Post: 04 May 2011 - 08:45 PM Rate Topic: -----

#1 polysean  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 04-May 11

Can't connect to MySQL server on 'localhost' (10061)

Posted 04 May 2011 - 08:15 PM

can you please! this is the error..
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\hshome\scaseduph\scas.edu.ph\form2.php on line 3
Could not connect: Can't connect to MySQL server on 'localhost' (10061)
Is This A Good Question/Topic? 0
  • +

Replies To: Can't connect to MySQL server on 'localhost' (10061)

#2 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 944
  • View blog
  • Posts: 2,353
  • Joined: 15-February 11

Re: Can't connect to MySQL server on 'localhost' (10061)

Posted 04 May 2011 - 08:26 PM

Which server are you using? (WAMP, XAMPP...)
Was This Post Helpful? 0
  • +
  • -

#3 polysean  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 04-May 11

Re: Can't connect to MySQL server on 'localhost' (10061)

Posted 04 May 2011 - 08:35 PM

View Postcodeprada, on 04 May 2011 - 08:26 PM, said:

Which server are you using? (WAMP, XAMPP...)


servobox server, phpMyadmin. i created a separate file of form using php and mysql, i run it directly to the browse but still it cant connect to the server..
Was This Post Helpful? 0
  • +
  • -

#4 polysean  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 04-May 11

Re: Can't connect to MySQL server on 'localhost' (10061)

Posted 04 May 2011 - 08:45 PM

View Postpolysean, on 04 May 2011 - 08:35 PM, said:

View Postcodeprada, on 04 May 2011 - 08:26 PM, said:

Which server are you using? (WAMP, XAMPP...)


servobox server, phpMyadmin. i created a separate file of form using php and mysql, i run it directly to the browse but still it cant connect to the server..



*** this is my codes. what user name can i insert at the connection? is it the one that i created at the control panel?
<?php
if (isset($_POST["submit"])){
$con = mysql_connect("localhost","name","password");
  if (!$con)
  {
  	die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("scasedu_registration", $con);
  $query="insert into students_information (id,Last Name) values('"
						.$_POST["id"].
						"','"
						.$_POST["lastname"].
						"')";
  mysql_query($query);
  mysql_close($con);
 $to = "plamo@scas.edu.ph";
 $subject = "test subject";
 $body = "Register".$_POST["lastName"];
 if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
  echo "save";
}
?>
<body>
<form id="form1" name="form1" method="post">
<p></p>

  <p align="center"> <span class="style2">Sumulong College of Arts and Sciences</span><br>
    SCAS Bldg., M.L. Quezon Ext. Brgy. Dalig, Antipolo City</p>
  <p align="center">APPLICATION FORM</p>
  <p>&nbsp;	</p>
  <fieldset>
  <legend>Basic Information</legend>
  
  <p>
    <label>id:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="id" type="text"  size="50" maxlength="20" />
    </label>
  </p>
  <p>
    <label>last name:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="lastname" type="text"  size="50" maxlength="20" />
    </label>
  </p>
<p>
    <label> 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" id="submit" value="Submit" />
    </label>
    <label>
  <input type="reset" name="reset" id="reset" value="Reset" />
  </label>
  </p>


MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 05 May 2011 - 02:46 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1